*/
void setEmailChangeStatus (final EmailChangeStatus emailChangeStatus);
+ /**
+ * Getter for email change hash
+ * <p>
+ * @return Email change hash
+ */
+ String getEmailChangeHash ();
+
+ /**
+ * Getter for email change hash
+ * <p>
+ * @param emailChangeHash Email change hash
+ */
+ void setEmailChangeHash (final String emailChangeHash);
+
@Override
boolean equals (final Object object);
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
+import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
* @author Roland Haeder<roland@mxchange.org>
*/
@Entity (name = "email_changes")
-@Table (name = "email_changes")
+@Table (
+ name = "email_changes",
+ indexes = {
+ @Index (name = "hash", columnList = "email_change_hash", unique = true)
+ }
+)
@NamedQueries (
@NamedQuery (name = "SearchEmailChangeByEmail", query = "SELECT e FROM email_changes AS e WHERE LOWER(e.emailAddress) LIKE LOWER(:email)")
)
@Column (name = "email_change_done", nullable = false, updatable = false)
private Calendar emailChangeDone;
+ /**
+ * Email change hash the user has to click
+ */
+ @Basic (optional = false)
+ @Column (name = "email_change_hash", unique = true)
+ private String emailChangeHash;
+
/**
* Email change id
*/
this.emailChangeDone = emailChangeDone;
}
+ @Override
+ public String getEmailChangeHash () {
+ return this.emailChangeHash;
+ }
+
+ @Override
+ public void setEmailChangeHash (final String emailChangeHash) {
+ this.emailChangeHash = emailChangeHash;
+ }
+
@Override
public Long getEmailChangeId () {
return this.emailChangeId;