I forgot to post my class:
@Entity
public class User implements IUser, Serializable{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String username;
private String email;
private String password;
private String firstName;
private String lastName;
private String usernameLowercase;
private String emailLowercase;
private String firstNameLowercase;
private String lastNameLowercase;
//@Basic
private String uid;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* @return the uid
*/
public String getUid() {
return uid;
}
/**
* @param uid the uid to set
*/
public void setUid(String uid) {
this.uid = uid;
}
private String passwordUnhashed;
private String confirmPasswordUnhashed;
public String getPasswordUnhashed() {
return passwordUnhashed;
}
public void setPasswordUnhashed(String passwordUnhashed) {
this.passwordUnhashed = passwordUnhashed;
}
public String getConfirmPasswordUnhashed() {
return confirmPasswordUnhashed;
}
public void setConfirmPasswordUnhashed(String
confirmPasswordUnhashed) {
this.confirmPasswordUnhashed = confirmPasswordUnhashed;
}
/**
* We user lowercase variations of our data for searching so we need
to
* add this prePersist method to save the data in a searchable format
*/
@PrePersist
@PreUpdate
public void prePersist() {
//save searchable username
if (username != null) {
usernameLowercase = username.toLowerCase();
} else {
usernameLowercase = null;
}
//save searchable email
if (email != null) {
emailLowercase = email.toLowerCase();
} else {
emailLowercase = null;
}
//save searchable first name
if (firstName != null) {
firstNameLowercase = firstName.toLowerCase();
} else {
firstNameLowercase = null;
}
//save searchable last name
if (lastName != null) {
lastNameLowercase = lastName.toLowerCase();
} else {
lastNameLowercase = null;
}
}
}
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.