From adad7ddf76f444f84943dda05d18a3b86b4f80c4 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 18:21:11 +0200 Subject: [PATCH] created unique index on email address --- src/org/mxchange/jcontacts/contact/UserContact.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; /** -- 2.39.5