Re: BeanEditForm onValidate()

"Christopher Dodunski" <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.