From c21778b45b9797043fc75fe679fae54ba9ed5a67 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 6 Mar 2016 19:26:07 +0100 Subject: [PATCH] Unique constrains are required as 2 users should NOT use 1 cellphone number --- src/org/mxchange/jcontacts/contact/UserContact.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/mxchange/jcontacts/contact/UserContact.java b/src/org/mxchange/jcontacts/contact/UserContact.java index 2a1c568..ede2cf4 100644 --- a/src/org/mxchange/jcontacts/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/contact/UserContact.java @@ -85,7 +85,7 @@ public class UserContact implements Contact, Comparable { /** * Cellphone number */ - @JoinColumn (name = "contact_cellphone_number_id", referencedColumnName = "cellphone_id") + @JoinColumn (name = "contact_cellphone_number_id", referencedColumnName = "cellphone_id", unique = true) @OneToOne (targetEntity = CellphoneNumber.class, cascade = CascadeType.ALL) private DialableCellphoneNumber contactCellphoneNumber; @@ -135,7 +135,7 @@ public class UserContact implements Contact, Comparable { /** * Fax number */ - @JoinColumn (name = "contact_fax_number_id", referencedColumnName = "fax_id") + @JoinColumn (name = "contact_fax_number_id", referencedColumnName = "fax_id", unique = true) @OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL) private DialableFaxNumber contactFaxNumber; @@ -179,7 +179,7 @@ public class UserContact implements Contact, Comparable { /** * Phone number */ - @JoinColumn (name = "contact_phone_number_id", referencedColumnName = "phone_id") + @JoinColumn (name = "contact_phone_number_id", referencedColumnName = "phone_id", unique = true) @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) private DialableLandLineNumber contactPhoneNumber; -- 2.39.5