From: Roland Haeder Date: Mon, 12 Oct 2015 16:21:11 +0000 (+0200) Subject: created unique index on email address X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=adad7ddf76f444f84943dda05d18a3b86b4f80c4;p=jcontacts-core.git created unique index on email address --- diff --git a/src/org/mxchange/jcontacts/contact/UserContact.java b/src/org/mxchange/jcontacts/contact/UserContact.java index b98dfd3..0797db4 100644 --- a/src/org/mxchange/jcontacts/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/contact/UserContact.java @@ -60,6 +60,11 @@ import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; @Index ( name = "contact_gender", columnList = "contact_gender" + ), + @Index ( + name = "contact_email_address", + unique = true, + columnList = "contact_email_address" ) } ) @@ -109,7 +114,7 @@ public class UserContact implements Contact, Comparable { * Country code */ @JoinColumn (name = "contact_country_id", nullable = false) - @OneToOne(targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER) + @OneToOne (targetEntity = CountryData.class, optional = false, fetch = FetchType.EAGER) private Country contactCountry; /** @@ -137,7 +142,7 @@ public class UserContact implements Contact, Comparable { * Fax number */ @JoinColumn (name = "contact_fax_number_id") - @OneToOne(targetEntity = FaxNumber.class,cascade = CascadeType.ALL) + @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL) private DialableFaxNumber contactFaxNumber; /**