From: Roland Häder Date: Wed, 18 Oct 2017 00:57:10 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0b6d1e775e886790e8a0f1ac96db8d003388dd43;p=jaddressbook-core.git Continued: - fixed imports - added curly braces for later more named queries Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jaddressbook/model/addressbook/entry/AddressbookEntry.java b/src/org/mxchange/jaddressbook/model/addressbook/entry/AddressbookEntry.java index 7db2136..439cdfa 100644 --- a/src/org/mxchange/jaddressbook/model/addressbook/entry/AddressbookEntry.java +++ b/src/org/mxchange/jaddressbook/model/addressbook/entry/AddressbookEntry.java @@ -20,7 +20,7 @@ import java.io.Serializable; import java.util.Date; import org.mxchange.jaddressbook.model.addressbook.Addressbook; import org.mxchange.jcontacts.model.contact.Contact; -import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; +import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; /** * A POJI for addressbook entries @@ -48,14 +48,14 @@ public interface AddressbookEntry extends Serializable { *

* @return Business contact */ - BusinessBasicData getAddressbookEntryBusinessContact (); + BasicData getAddressbookEntryBusinessContact (); /** * Setter for business contact *

* @param addressbookEntryBusinessContact Business contact */ - void setAddressbookEntryBusinessContact (final BusinessBasicData addressbookEntryBusinessContact); + void setAddressbookEntryBusinessContact (final BasicData addressbookEntryBusinessContact); /** * Getter for entry created timestamp diff --git a/src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java b/src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java index 885929f..3e71d21 100644 --- a/src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java +++ b/src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java @@ -37,7 +37,7 @@ import org.mxchange.jaddressbook.model.addressbook.Addressbook; import org.mxchange.jaddressbook.model.addressbook.UserAddressbook; import org.mxchange.jcontacts.model.contact.Contact; import org.mxchange.jcontacts.model.contact.UserContact; -import org.mxchange.jcontactsbusiness.model.basicdata.CompanyBasicData; +import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; /** @@ -48,9 +48,12 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; @Entity (name = "addressbook_entries") @Table (name = "addressbook_entries") @NamedQueries ( - @NamedQuery ( - name = "SearchUsersAddressbookEntries", - query = "SELECT e FROM addressbook_entries AS e INNER JOIN addressbooks AS a ON e.addressbookId = a WHERE e.addressbookId = :addressbook AND a.addressbookUser = :owner ORDER BY e.addressbookEntryId ASC") + { + @NamedQuery ( + name = "SearchUsersAddressbookEntries", + query = "SELECT e FROM addressbook_entries AS e INNER JOIN addressbooks AS a ON e.addressbookId = a WHERE e.addressbookId = :addressbook AND a.addressbookUser = :owner ORDER BY e.addressbookEntryId ASC" + ) + } ) @SuppressWarnings ("PersistenceUnitPresent") public class UserAddressbookEntry implements AddressbookEntry { @@ -65,8 +68,8 @@ public class UserAddressbookEntry implements AddressbookEntry { * Connection to table "business_contacts" (commercial contacts) */ @JoinColumn (name = "entry_business_contact_id", updatable = false) - @OneToOne (targetEntity = CompanyBasicData.class, cascade = CascadeType.REFRESH) - private BusinessBasicData addressbookEntryBusinessContact; + @OneToOne (targetEntity = BusinessBasicData.class, cascade = CascadeType.REFRESH) + private BasicData addressbookEntryBusinessContact; /** * When this address book entry has been created @@ -131,12 +134,12 @@ public class UserAddressbookEntry implements AddressbookEntry { } @Override - public BusinessBasicData getAddressbookEntryBusinessContact () { + public BasicData getAddressbookEntryBusinessContact () { return this.addressbookEntryBusinessContact; } @Override - public void setAddressbookEntryBusinessContact (final BusinessBasicData addressbookEntryBusinessContact) { + public void setAddressbookEntryBusinessContact (final BasicData addressbookEntryBusinessContact) { this.addressbookEntryBusinessContact = addressbookEntryBusinessContact; }