From: Roland Haeder Date: Sun, 17 Apr 2016 12:08:44 +0000 (+0200) Subject: Added named query "AllContactsByCellphone" for finding all contacts for given cellpho... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e7dd641905ecabf267acb15fe0657eafda552a7f;p=jcontacts-core.git Added named query "AllContactsByCellphone" for finding all contacts for given cellphone id --- diff --git a/src/org/mxchange/jcontacts/contact/UserContact.java b/src/org/mxchange/jcontacts/contact/UserContact.java index 8aeda22..a0b8299 100644 --- a/src/org/mxchange/jcontacts/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/contact/UserContact.java @@ -31,6 +31,8 @@ import javax.persistence.Id; import javax.persistence.Index; import javax.persistence.JoinColumn; import javax.persistence.Lob; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.Temporal; @@ -66,6 +68,9 @@ import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; ) } ) +@NamedQueries( + @NamedQuery(name = "AllContactsByCellphone", query = "SELECT c FROM contacts AS c WHERE c.contactCellphoneNumber = :cellPhone ORDER BY c.contactId ASC") +) public class UserContact implements Contact { /**