- the to-be-referenced contact instance need to be persisted first, an existing
primary key (we believe here it isn't fake) is a good indication for that
*/
package org.mxchange.jcustomercore.model.customer;
*/
package org.mxchange.jcustomercore.model.customer;
+import java.text.MessageFormat;
import java.util.Date;
import java.util.Objects;
import javax.persistence.Basic;
import java.util.Date;
import java.util.Objects;
import javax.persistence.Basic;
} else if (null == customerContact) {
// Throw NPE again
throw new NullPointerException("customerContact is null"); //NOI18N
} else if (null == customerContact) {
// Throw NPE again
throw new NullPointerException("customerContact is null"); //NOI18N
+ } else if (customerContact.getContactId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("customerContact.contactId is null"); //NOI18N
+ } else if (customerContact.getContactId() < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("customerContact.contactId={0} is invalid", customerContact.getContactId())); //NOI18N
} else if (null == customerNumber) {
// Throw NPE again
throw new NullPointerException("customerNumber is null"); //NOI18N
} else if (null == customerNumber) {
// Throw NPE again
throw new NullPointerException("customerNumber is null"); //NOI18N