)
@NamedQueries (
{
- @NamedQuery( name = "AllContacts", query = "SELECT c FROM contacts AS c ORDER BY c.contactId ASC"),
- @NamedQuery( name = "AllContactEmailAddresses", query = "SELECT c.contactEmailAddress FROM contacts AS c ORDER BY c.contactId ASC"),
+ @NamedQuery (name = "AllContacts", query = "SELECT c FROM contacts AS c ORDER BY c.contactId ASC"),
+ @NamedQuery (name = "AllContactEmailAddresses", query = "SELECT c.contactEmailAddress FROM contacts AS c ORDER BY c.contactId ASC"),
@NamedQuery (name = "AllContactsByCellphone", query = "SELECT c FROM contacts AS c WHERE c.contactCellphoneNumber = :cellPhone ORDER BY c.contactId ASC"),
- @NamedQuery (name = "SearchContactById", query = "SELECT c FROM contacts AS c WHERE c.contactId = :contactId")
+ @NamedQuery (name = "SearchContactById", query = "SELECT c FROM contacts AS c WHERE c.contactId = :contactId"),
+ @NamedQuery(name = "SearchContactByEmailAddress", query = "SELECT c FROM contacts AS c WHERE c.contactEmailAddress = :emailAddress")
}
)
@SuppressWarnings ("PersistenceUnitPresent")
/**
* Constructor for contactGender and names
* <p>
- * @param contactGender Gender instance
- * @param contactFirstName First name
+ * @param contactGender Gender instance
+ * @param contactFirstName First name
* @param contactFamilyName Family name
*/
public UserContact (final Gender contactGender, final String contactFirstName, final String contactFamilyName) {
* Constructor with contact id and causing exception
* <p>
* @param contactId Contact id
- * @param cause Causing exception
+ * @param cause Causing exception
*/
public ContactNotFoundException (final Long contactId, final Throwable cause) {
// Call super constructor with message and cause
super(MessageFormat.format("Contact with id {0} was not found.", contactId), cause); //NOI18N
}
+ /**
+ * Constructor with email address and causing exception
+ * <p>
+ * @param emailAddress Email address
+ * @param cause Causing exception
+ */
+ public ContactNotFoundException (final String emailAddress, final Throwable cause) {
+ // Call super constructor with message and cause
+ super(MessageFormat.format("Contact with email address {0} was not found.", emailAddress), cause); //NOI18N
+ }
+
}