libs.jpa20-persistence.classpath=\
${base}/jpa20-persistence/javax.persistence_2.1.0.v201304241213.jar
libs.jpa20-persistence.displayName=Persistence (JPA 2.1)
-libs.jpa20-persistence.javadoc=
+libs.jpa20-persistence.javadoc=\
+ https://docs.oracle.com/javaee/7/api/
libs.jpa20-persistence.prop-maven-dependencies=org.eclipse.persistence:javax.persistence:2.1.0:jar
/**
* Cellphone number
*/
- @JoinColumn (name = "contact_cellphone_number_id")
+ @JoinColumn (name = "contact_cellphone_number_id", referencedColumnName = "cellphone_id")
@OneToOne (targetEntity = CellphoneNumber.class, cascade = CascadeType.ALL)
private DialableCellphoneNumber contactCellphoneNumber;
/**
* Country code
*/
- @JoinColumn (name = "contact_country_id", nullable = false)
+ @JoinColumn (name = "contact_country_id", nullable = false, referencedColumnName = "country_id")
@OneToOne (targetEntity = CountryData.class, cascade = CascadeType.MERGE, optional = false, fetch = FetchType.EAGER)
private Country contactCountry;
/**
* Fax number
*/
- @JoinColumn (name = "contact_fax_number_id")
+ @JoinColumn (name = "contact_fax_number_id", referencedColumnName = "fax_id")
@OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
private DialableFaxNumber contactFaxNumber;
/**
* Phone number
*/
- @JoinColumn (name = "contact_phone_number_id")
+ @JoinColumn (name = "contact_phone_number_id", referencedColumnName = "phone_id")
@OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
private DialableLandLineNumber contactPhoneNumber;
* @param contactFamilyName Family name
*/
public UserContact (final Gender contactGender, final String contactFirstName, final String contactFamilyName) {
+ // Call other constructor
+ this();
+
// Set all
this.contactGender = contactGender;
this.contactFirstName = contactFirstName;
* Default constructor
*/
public UserContact () {
+ // Default is not user's own contact
+ this.contactOwnContact = Boolean.FALSE;
}
- /**
- * Compares two contacts with each other
- * <p>
- * @param contact Contact comparator
- * <p>
- * @return Comparison value
- */
@Override
public int compareTo (final Contact contact) {
// contact should not be null