Below is a snippet of my User entity class, where the NamedQueries are
also located.

Based on your responses, it seems that I'm correct that UpdateUser.java
oughtn't be persisting anything for NamedQuery to discover until the line
"crudServiceDAO.update(user)" is reached in onSuccessFromUpdateForm().  In
other words, fault is with the query and not with BeanEditForm prematurely
saving the altered entity, yes?


==================================================
            User.java
==================================================

@Entity
@NamedQueries({
        @NamedQuery(name = User.ALL, query = "Select u from User u"),
        @NamedQuery(name = User.BY_USERNAME, query = "Select u from User u
where u.userName = :userName"),
        @NamedQuery(name = User.BY_EMAIL, query = "Select u from User u
where u.email = :email"),
        @NamedQuery(name = User.BY_USERNAME_OR_EMAIL, query = "Select u
from User u where u.userName = :userName or u.email = :email"),
        @NamedQuery(name = User.BY_CREDENTIALS, query = "Select u from
User u where u.userName = :userName and u.password = :password")
})
@Table(name="USER")
public class User {

    public static final String ALL = "User.all";
    public static final String BY_USERNAME = "User.byUserName";
    public static final String BY_EMAIL = "User.byEmail";
    public static final String BY_USERNAME_OR_EMAIL =
"User.byUserNameOrEmail";
    public static final String BY_CREDENTIALS = "User.byCredentials";
    private static final long serialVersionUID = 4060967693790504175L;

    @Id
    @NonVisual
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="USER_ID")
    private long id;

    //@NaturalId
    @Column(name="USER_NAME", nullable=false, unique=true, length=50)
    @Validate("required")
    @NotNull
    @Size(min = 4, max = 50)
    @Alphanumeric
    private String userName;


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to