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 = "users")
-@Table (name = "users")
+@Table (
+ name = "users",
+ indexes =
+ @Index (
+ name = "confirmation_key",
+ unique = true,
+ columnList = "user_confirm_key"
+ )
+)
@NamedQueries (
{
@NamedQuery (name = "AllUserNames", query = "SELECT DISTINCT u.userName FROM users AS u ORDER BY u.userId ASC"),
/**
* Id number from "contacts" table
*/
- @JoinColumn (name = "contact_id", nullable = false, updatable = false)
- @OneToOne (cascade = CascadeType.ALL, targetEntity = UserContact.class, optional = false)
+ @JoinColumn (name = "user_contact_id", nullable = false, updatable = false)
+ @OneToOne (targetEntity = UserContact.class, optional = false, cascade = CascadeType.ALL)
private Contact userContact;
/**