]> git.mxchange.org Git - jjobs-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 24 Nov 2019 04:29:41 +0000 (05:29 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 15 Jan 2020 10:26:07 +0000 (11:26 +0100)
- renamed BaseFinancialsDatabaseBean to BaseFinancialsEnterpriseBean
- also moved it to proper "enterprise" package

Signed-off-by: Roland Häder <roland@mxchange.org>
32 files changed:
src/java/org/mxchange/jcontacts/model/contact/JobsAdminContactSessionBean.java
src/java/org/mxchange/jcontacts/model/contact/JobsContactSessionBean.java
src/java/org/mxchange/jcontacts/model/phone/JobsAdminContactPhoneSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/basicdata/JobsAdminBusinessDataSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/basicdata/JobsBusinessDataSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/branchoffice/JobsAdminBranchOfficeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/branchoffice/JobsBranchOfficeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/department/JobsAdminDepartmentSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/department/JobsDepartmentSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/employee/JobsAdminCompanyEmployeeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/employee/JobsCompanyEmployeeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsAdminHeadquarterSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsHeadquarterSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/opening_time/JobsAdminOpeningTimesSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/opening_time/JobsOpeningTimesSessionBean.java
src/java/org/mxchange/jcountry/model/data/JobsAdminCountrySingletonBean.java
src/java/org/mxchange/jcountry/model/data/JobsCountrySingletonBean.java
src/java/org/mxchange/jjobs/beans/ejb/BaseJobsEnterpriseBean.java [deleted file]
src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/model/addressbook/JobsAddressbookSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/mobileprovider/JobsAdminMobileProviderSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/mobileprovider/JobsMobileProviderSingletonBean.java
src/java/org/mxchange/jphone/model/phonenumbers/phone/JobsAdminPhoneSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/phone/JobsPhoneSessionBean.java
src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/activity/JobsUserActivityLogMessageBean.java
src/java/org/mxchange/jusercore/model/user/email_address/JobsUserEmailChangeSessionBean.java
src/java/org/mxchange/jusercore/model/user/password_history/JobsUserPasswordHistorySessionBean.java
src/java/org/mxchange/juserlogincore/model/user/login/JobsUserLoginSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/JobsUserRegistrationSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/resendlink/JobsResendLinkSessionBean.java

index 45019681178b5379575de3e05b891408d90850fc..951393719e458f8ff24b432b66b348ad35a9eece 100644 (file)
@@ -23,7 +23,7 @@ import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * An administrative contact EJB
index 4a92d194ce852a07a5fa280ec9d504f96f05b9b0..4e3fe0b3a27cf7066c374b298571678f8b3e4d87 100644 (file)
@@ -24,7 +24,7 @@ import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A contact EJB
index f49b690f5e7c9dfa51846a012eee4998850072cf..87d28193aa5b7a68bd29b0edd500a1f99d2db8fb 100644 (file)
@@ -22,7 +22,7 @@ import java.util.Objects;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.exceptions.phone.PhoneNumberAlreadyLinkedException;
 import org.mxchange.jphone.exceptions.phone.PhoneNumberNotLinkedException;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
@@ -57,7 +57,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact linkExistingFaxNumberWithContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException {
+       public Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingFaxNumberWithContact: contact={1},faxNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, faxNumber)); //NOI18N
 
@@ -71,7 +71,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                } else if (contact.getContactId() < 1) {
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
-               } else if (contact.getContactFaxNumber() instanceof org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber) {
+               } else if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
                        // Not set cell phone instance
                        throw new PhoneNumberAlreadyLinkedException(faxNumber);
                } else if (null == faxNumber) {
@@ -104,7 +104,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactFaxNumber(faxNumber);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingFaxNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
@@ -114,7 +114,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact linkExistingLandLineNumberWithContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException {
+       public Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingLandLineNumberWithContact: contact={1},landLineNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, landLineNumber)); //NOI18N
 
@@ -128,7 +128,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                } else if (contact.getContactId() < 1) {
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
-               } else if (contact.getContactLandLineNumber() instanceof org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber) {
+               } else if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
                        // Not set cell phone instance
                        throw new PhoneNumberAlreadyLinkedException(landLineNumber);
                } else if (null == landLineNumber) {
@@ -161,7 +161,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactLandLineNumber(landLineNumber);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingLandLineNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
@@ -171,7 +171,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact linkExistingMobileNumberWithContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException {
+       public Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingMobileNumberWithContact: contact={1},mobileNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, mobileNumber)); //NOI18N
 
@@ -185,7 +185,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                } else if (contact.getContactId() < 1) {
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
-               } else if (contact.getContactMobileNumber() instanceof org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber) {
+               } else if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
                        // Not set cell phone instance
                        throw new PhoneNumberAlreadyLinkedException(mobileNumber);
                } else if (null == mobileNumber) {
@@ -212,7 +212,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactMobileNumber(mobileNumber);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkExistingMobileNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
@@ -222,7 +222,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact linkNewFaxNumberWithContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException {
+       public Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewFaxNumberWithContact: contact={1},faxNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, faxNumber)); //NOI18N
 
@@ -236,7 +236,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                } else if (contact.getContactId() < 1) {
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
-               } else if (contact.getContactFaxNumber() instanceof org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber) {
+               } else if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
                        // Not set cell phone instance
                        throw new PhoneNumberAlreadyLinkedException(faxNumber);
                } else if (null == faxNumber) {
@@ -269,7 +269,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactFaxNumber(faxNumber);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewFaxNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
@@ -279,7 +279,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact linkNewLandLineNumberWithContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException {
+       public Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewLandLineNumberWithContact: contact={1},landLineNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, landLineNumber)); //NOI18N
 
@@ -293,7 +293,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                } else if (contact.getContactId() < 1) {
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
-               } else if (contact.getContactLandLineNumber() instanceof org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber) {
+               } else if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
                        // Not set cell phone instance
                        throw new PhoneNumberAlreadyLinkedException(landLineNumber);
                } else if (null == landLineNumber) {
@@ -326,7 +326,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactLandLineNumber(landLineNumber);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewLandLineNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
@@ -336,7 +336,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact linkNewMobileNumberWithContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException {
+       public Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewMobileNumberWithContact: contact={1},mobileNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, mobileNumber)); //NOI18N
 
@@ -350,7 +350,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                } else if (contact.getContactId() < 1) {
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
-               } else if (contact.getContactMobileNumber() instanceof org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber) {
+               } else if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
                        // Not set cell phone instance
                        throw new PhoneNumberAlreadyLinkedException(mobileNumber);
                } else if (null == mobileNumber) {
@@ -377,7 +377,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactMobileNumber(mobileNumber);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkNewMobileNumberWithContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
@@ -387,7 +387,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact unlinkFaxDataFromContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException {
+       public Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkFaxDataFromContact: contact={1},faxNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, faxNumber)); //NOI18N
 
@@ -419,7 +419,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactFaxNumber(null);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkFaxDataFromContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
@@ -429,7 +429,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact unlinkLandLineDataFromContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException {
+       public Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkLandLineDataFromContact: contact={1},landLineNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, landLineNumber)); //NOI18N
 
@@ -461,7 +461,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactLandLineNumber(null);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkLandLineDataFromContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
@@ -471,7 +471,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
        }
 
        @Override
-       public org.mxchange.jcontacts.model.contact.Contact unlinkMobileDataFromContact (final org.mxchange.jcontacts.model.contact.Contact contact, final org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException {
+       public Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkMobileDataFromContact: contact={1},mobileNumber={2} - CALLED!", this.getClass().getSimpleName(), contact, mobileNumber)); //NOI18N
 
@@ -503,7 +503,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean imp
                contact.setContactMobileNumber(null);
 
                // Update database
-               final org.mxchange.jcontacts.model.contact.Contact updatedContact = this.contactBean.updateContactData(contact);
+               final Contact updatedContact = this.contactBean.updateContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.unlinkMobileDataFromContact: updatedContact={1} - EXIT!", this.getClass().getSimpleName(), updatedContact)); //NOI18N
index 12846c037d4bc5195f4b486d24be90803413f9af..c67d8568c6cdc7a7b63e79514c637e92773e5c3a 100644 (file)
@@ -25,7 +25,7 @@ import javax.ejb.Stateless;
 import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException;
 import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
index cda0402a5ff075f611182b5627b57c22fde81a60..3b0082a1b0897738c3f9563bf6512b4fc424e0c2 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for business data
index adbc830d52c9338d8b9cf9b738a190bc0991b3ca..96c1ea4a28e39f3e317b47509dbedb5fe49f0abd 100644 (file)
@@ -25,7 +25,7 @@ import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeAlread
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -94,9 +94,9 @@ public class JobsAdminBranchOfficeSessionBean extends BaseJobsEnterpriseBean imp
                }
 
                // Is user instance set?
-               if (branchOffice.getBranchCountry() instanceof org.mxchange.jcountry.model.data.Country) {
+               if (branchOffice.getBranchCountry() instanceof Country) {
                        // Get managed instance back
-                       final org.mxchange.jcountry.model.data.Country managedCountry = this.createManaged(branchOffice.getBranchCountry());
+                       final Country managedCountry = this.createManaged(branchOffice.getBranchCountry());
 
                        // Set it back in branch office
                        branchOffice.setBranchCountry(managedCountry);
index d255fe712637a107b1857c691ead7a9d07dfb07f..0550f3ae29e1e83649741f868c4bf663d84ae761 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for general branch office purposes
index 6a8cb26d3b732bfaea9bda592c7799e1ff516433..8427f848a58e58fb38288d47d16848f7f3a7d9b5 100644 (file)
@@ -26,7 +26,7 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
index 1501b58173aad3613fa8c764bf348a14e025585e..935d5a0dc7f3dffd89850728f4e48695b7783a70 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for general department purposes
index 0d3cb6dc40bcb59dde57f1a0783e9eb7cb8ed46e..cc808c6e1f0a56d953511911b8b0e5ec0587ad0b 100644 (file)
@@ -26,7 +26,7 @@ import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.Department;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
 import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.model.user.User;
index d505a61c76f581f68b76c9a94f4031b3e4553d54..5f7aa67b9a9e85aea6a3add0fbdab960174a1e30 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A stateless bean for general purposes for company employees.
index 7f6e77d3061460809bc3b732742e7bdd4d4ea75d..5b6df0129cac64edc3f9d4cc9c4b21de995dddb1 100644 (file)
@@ -24,7 +24,7 @@ import javax.ejb.Stateless;
 import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterAlreadyAddedException;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
index 85a14174ae97933dd57577f02f373747d70694f6..56574daf18075c89c5dd801fa9bc6b7344826b3b 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for general headquarter purposes
index bc266c12a2564c9aed24ba0a58795b69deaef1c4..4eb66a3ba3e75cd4316847dabb5a0dcc3631e3c7 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.jcontactsbusiness.model.opening_time;
 import java.text.MessageFormat;
 import java.util.Date;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for administrative opening times purposes
index 82444dcccb48a36df8573fed4b17ed0662d5a279..e3b1e6b2ef5c15b7cbdc101d67b3deb659a56681 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for general opening times purposes
index b4ee6da1a8f172c76f229437c9fd35873e5f6c09..d0410961a5bd31395363181f3cd14a2b07ebf9ad 100644 (file)
@@ -22,7 +22,7 @@ import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A stateless EJB for administrative country purposes
index 8220021c1a520d7c8ee4983149bcf1302b05a751..4350d5d0e4233e830319e6a90f116d5d91bbd264 100644 (file)
@@ -21,7 +21,7 @@ import java.util.List;
 import javax.ejb.Singleton;
 import javax.ejb.Startup;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A singleton EJB for country informations
diff --git a/src/java/org/mxchange/jjobs/beans/ejb/BaseJobsEnterpriseBean.java b/src/java/org/mxchange/jjobs/beans/ejb/BaseJobsEnterpriseBean.java
deleted file mode 100644 (file)
index fbe1a43..0000000
+++ /dev/null
@@ -1,1474 +0,0 @@
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.ejb;
-
-import java.text.MessageFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.Properties;
-import javax.ejb.EJBException;
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.mail.Address;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jcontacts.model.contact.Contacts;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
-import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
-import org.mxchange.jcoreee.bean.ejb.BaseEnterpriseBean;
-import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jmailee.model.delivery.wrapper.EmailDeliveryWrapper;
-import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
-import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
-import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
-import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
-import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
-import org.mxchange.jphone.utils.PhoneUtils;
-import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.Users;
-
-/**
- * A helper class for beans that access the database.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 12_895_410_275_811_963L;
-
-       /**
-        * Protected constructor
-        */
-       protected BaseJobsEnterpriseBean () {
-               // Call super constructor
-               super();
-       }
-
-       /**
-        * Constructor with queue factory JNDI and queue JNDI names
-        * <p>
-        * @param factoryJndi JNDI name for queue factory
-        * @param queueJndi   JNDI name for email queue
-        */
-       protected BaseJobsEnterpriseBean (final String factoryJndi, final String queueJndi) {
-               // Call super constructor
-               super(factoryJndi, queueJndi);
-       }
-
-       /**
-        * Get back a managed instance from given contact
-        * <p>
-        * @param contact Unmanaged/detached contact instance
-        * <p>
-        * @return Managed contact instance
-        */
-       protected Contact createManaged (final Contact contact) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
-
-               // user should not be null
-               if (null == contact) {
-                       // Abort here
-                       throw new NullPointerException("contact is null"); //NOI18N
-               } else if (contact.getContactId() == null) {
-                       // Id is set
-                       throw new NullPointerException("contact.contactId is null"); //NOI18N
-               } else if (contact.getContactId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final Contact managedContact = this.getEntityManager().find(contact.getClass(), contact.getContactId());
-
-               // Should be there
-               assert (managedContact instanceof Contact) : "managedContact is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
-
-               // Return it
-               return managedContact;
-       }
-
-       /**
-        * Get back a managed instance from given country
-        * <p>
-        * @param country Unmanaged/detached country instance
-        * <p>
-        * @return Managed country instance
-        */
-       protected Country createManaged (final Country country) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: country={1} - CALLED!", this.getClass().getSimpleName(), country)); //NOI18N
-
-               // user should not be null
-               if (null == country) {
-                       // Abort here
-                       throw new NullPointerException("country is null"); //NOI18N
-               } else if (country.getCountryId() == null) {
-                       // Id is set
-                       throw new NullPointerException("country.countryId is null"); //NOI18N
-               } else if (country.getCountryId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("country.countryId={0} is invalid", country.getCountryId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final Country managedCountry = this.getEntityManager().find(country.getClass(), country.getCountryId());
-
-               // Should be there
-               assert (managedCountry instanceof Country) : "managedCountry is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedCountry={1} - EXIT!", this.getClass().getSimpleName(), managedCountry)); //NOI18N
-
-               // Return it
-               return managedCountry;
-       }
-
-       /**
-        * Get back a managed instance from given basic data
-        * <p>
-        * @param basicData Unmanaged/detached basic data instance
-        * <p>
-        * @return Managed basic data instance
-        */
-       protected BasicData createManaged (final BasicData basicData) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: basicData={1} - CALLED!", this.getClass().getSimpleName(), basicData)); //NOI18N
-
-               // user should not be null
-               if (null == basicData) {
-                       // Abort here
-                       throw new NullPointerException("basicData is null"); //NOI18N
-               } else if (basicData.getBasicDataId() == null) {
-                       // Id is set
-                       throw new NullPointerException("basicData.basicDataId is null"); //NOI18N
-               } else if (basicData.getBasicDataId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("basicData.basicDataId={0} is invalid", basicData.getBasicDataId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final BasicData managedBasicData = this.getEntityManager().find(basicData.getClass(), basicData.getBasicDataId());
-
-               // Should be there
-               assert (managedBasicData instanceof BasicData) : "managedBasicData is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedBasicData={1} - EXIT!", this.getClass().getSimpleName(), managedBasicData)); //NOI18N
-
-               // Return it
-               return managedBasicData;
-       }
-
-       /**
-        * Get back a managed instance from given branch office
-        * <p>
-        * @param headquarter Unmanaged/detached branch office instance
-        * <p>
-        * @return Managed basic data instance
-        */
-       protected BranchOffice createManaged (final BranchOffice headquarter) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
-
-               // user should not be null
-               if (null == headquarter) {
-                       // Abort here
-                       throw new NullPointerException("headquarter is null"); //NOI18N
-               } else if (headquarter.getBranchId() == null) {
-                       // Id is set
-                       throw new NullPointerException("headquarter.headquarterId is null"); //NOI18N
-               } else if (headquarter.getBranchId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is invalid", headquarter.getBranchId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final BranchOffice managedBranchOffice = this.getEntityManager().find(headquarter.getClass(), headquarter.getBranchId());
-
-               // Should be there
-               assert (managedBranchOffice instanceof BranchOffice) : "managedBranchOffice is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedBranchOffice={1} - EXIT!", this.getClass().getSimpleName(), managedBranchOffice)); //NOI18N
-
-               // Return it
-               return managedBranchOffice;
-       }
-
-       /**
-        * Get back a managed instance from given department
-        * <p>
-        * @param department Unmanaged/detached department instance
-        * <p>
-        * @return Managed department instance
-        */
-       protected Department createManaged (final Department department) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: department={1} - CALLED!", this.getClass().getSimpleName(), department)); //NOI18N
-
-               // user should not be null
-               if (null == department) {
-                       // Abort here
-                       throw new NullPointerException("department is null"); //NOI18N
-               } else if (department.getDepartmentId() == null) {
-                       // Id is set
-                       throw new NullPointerException("department.departmentId is null"); //NOI18N
-               } else if (department.getDepartmentId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("department.departmentId={0} is invalid", department.getDepartmentId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final Department managedDepartment = this.getEntityManager().find(department.getClass(), department.getDepartmentId());
-
-               // Should be there
-               assert (managedDepartment instanceof Department) : "managedDepartment is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedDepartment={1} - EXIT!", this.getClass().getSimpleName(), managedDepartment)); //NOI18N
-
-               // Return it
-               return managedDepartment;
-       }
-
-       /**
-        * Get back a managed instance from given employee
-        * <p>
-        * @param employee Unmanaged/detached employee instance
-        * <p>
-        * @return Managed employee instance
-        */
-       protected Employable createManaged (final Employable employee) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: employee={1} - CALLED!", this.getClass().getSimpleName(), employee)); //NOI18N
-
-               // user should not be null
-               if (null == employee) {
-                       // Abort here
-                       throw new NullPointerException("employee is null"); //NOI18N
-               } else if (employee.getEmployeeId() == null) {
-                       // Id is set
-                       throw new NullPointerException("employee.employeeId is null"); //NOI18N
-               } else if (employee.getEmployeeId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeId={0} is invalid", employee.getEmployeeId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final Employable managedEmployee = this.getEntityManager().find(employee.getClass(), employee.getEmployeeId());
-
-               // Should be there
-               assert (managedEmployee instanceof Employable) : "managedEmployee is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedEmployee={1} - EXIT!", this.getClass().getSimpleName(), managedEmployee)); //NOI18N
-
-               // Return it
-               return managedEmployee;
-       }
-
-       /**
-        * Get back a managed instance from given jobPosition
-        * <p>
-        * @param jobPosition Unmanaged/detached job position instance
-        * <p>
-        * @return Managed job position instance
-        */
-       protected HireableJobPosition createManaged (final HireableJobPosition jobPosition) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: jobPosition={1} - CALLED!", this.getClass().getSimpleName(), jobPosition)); //NOI18N
-
-               // user should not be null
-               if (null == jobPosition) {
-                       // Abort here
-                       throw new NullPointerException("jobPosition is null"); //NOI18N
-               } else if (jobPosition.getJobPositionId() == null) {
-                       // Id is set
-                       throw new NullPointerException("jobPosition.jobPositionId is null"); //NOI18N
-               } else if (jobPosition.getJobPositionId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("jobPosition.jobPositionId={0} is invalid", jobPosition.getJobPositionId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final HireableJobPosition managedJobPosition = this.getEntityManager().find(jobPosition.getClass(), jobPosition.getJobPositionId());
-
-               // Should be there
-               assert (managedJobPosition instanceof HireableJobPosition) : "managedJobPosition is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedJobPosition={1} - EXIT!", this.getClass().getSimpleName(), managedJobPosition)); //NOI18N
-
-               // Return it
-               return managedJobPosition;
-       }
-
-       /**
-        * Get back a managed instance from given headquarter
-        * <p>
-        * @param headquarter Unmanaged/detached headquarter instance
-        * <p>
-        * @return Managed basic data instance
-        */
-       protected Headquarter createManaged (final Headquarter headquarter) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
-
-               // user should not be null
-               if (null == headquarter) {
-                       // Abort here
-                       throw new NullPointerException("headquarter is null"); //NOI18N
-               } else if (headquarter.getHeadquarterId() == null) {
-                       // Id is set
-                       throw new NullPointerException("headquarter.headquarterId is null"); //NOI18N
-               } else if (headquarter.getHeadquarterId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is invalid", headquarter.getHeadquarterId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final Headquarter managedHeadquarter = this.getEntityManager().find(headquarter.getClass(), headquarter.getHeadquarterId());
-
-               // Should be there
-               assert (managedHeadquarter instanceof Headquarter) : "managedHeadquarter is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedHeadquarter={1} - EXIT!", this.getClass().getSimpleName(), managedHeadquarter)); //NOI18N
-
-               // Return it
-               return managedHeadquarter;
-       }
-
-       /**
-        * Get back a managed instance from given mobile provider
-        * <p>
-        * @param mobileProvider Unmanaged/detached mobile provider instance
-        * <p>
-        * @return Managed mobile provider instance
-        */
-       protected MobileProvider createManaged (final MobileProvider mobileProvider) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: mobileProvider={1} - CALLED!", this.getClass().getSimpleName(), mobileProvider)); //NOI18N
-
-               // user should not be null
-               if (null == mobileProvider) {
-                       // Abort here
-                       throw new NullPointerException("mobileProvider is null"); //NOI18N
-               } else if (mobileProvider.getProviderId() == null) {
-                       // Id is set
-                       throw new NullPointerException("mobileProvider.providerId is null"); //NOI18N
-               } else if (mobileProvider.getProviderId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("mobileProvider.providerId={0} is invalid", mobileProvider.getProviderId())); //NOI18N
-               }
-
-               // Try to find it (should be there)
-               final MobileProvider managedMobileProvider = this.getEntityManager().find(mobileProvider.getClass(), mobileProvider.getProviderId());
-
-               // Should be there
-               assert (managedMobileProvider instanceof MobileProvider) : "managedMobileProvider is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedMobileProvider={1} - EXIT!", this.getClass().getSimpleName(), managedMobileProvider)); //NOI18N
-
-               // Return it
-               return managedMobileProvider;
-       }
-
-       /**
-        * Get back a managed instance from given user
-        * <p>
-        * @param user Unmanaged/detached user instance
-        * <p>
-        * @return Managed user instance
-        */
-       protected User createManaged (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
-
-               // user should not be null
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Id is set
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is invalid", user.getUserId())); //NOI18N
-               } else if (user.getUserContact() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userContact is null"); //NOI18N
-               } else if (user.getUserContact().getContactId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userContact.contactId is null"); //NOI18N
-               } else if (user.getUserContact().getContactId() < 1) {
-                       // Not valid id number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userContact.contactId={0} is not valid", user.getUserContact().getContactId())); //NOI18N#
-               }
-
-               // Try to find it (should be there)
-               final User managedUser = this.getEntityManager().find(user.getClass(), user.getUserId());
-
-               // Should be there
-               assert (managedUser instanceof User) : "managedUser is null"; //NOI18N
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N
-
-               // Return it
-               return managedUser;
-       }
-
-       /**
-        * Updates all contact's phone entry's created timestamps
-        * <p>
-        * @param contact Contact instance to update
-        */
-       protected void setAllContactPhoneEntriesCreated (final Contact contact) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
-
-               // The contact instance must be valid
-               if (null == contact) {
-                       // Throw NPE again
-                       throw new NullPointerException("contact is null"); //NOI18N
-               }
-
-               // Get all phone instances
-               final DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
-               final DialableFaxNumber faxNumber = contact.getContactFaxNumber();
-               final DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: landLineNumber={1},faxNumber={2},mobileNumber={3}", this.getClass().getSimpleName(), landLineNumber, faxNumber, mobileNumber)); //NOI18N
-
-               // Is a phone number instance set?
-               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for land-line number ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Set updated timestamp
-                       landLineNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Is a fax number instance set?
-               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for fax number ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Set updated timestamp
-                       faxNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Is a mobile number instance set?
-               if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for mobile number ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Set updated timestamp
-                       mobileNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: EXIT!", this.getClass().getSimpleName())); //NOI18N
-       }
-
-       /**
-        * Sets created timestamp on all opening times.
-        * <p>
-        * @param openingTimes Opening times list
-        * <p>
-        * @throws NullPointerException If given list is null
-        * @throws IllegalArgumentException If given list is empty
-        * @throws IllegalStateException If openingId is not null
-        */
-       protected void setAllOpeningTimesCreated (final List<OpeningTime> openingTimes) {
-               // Validate parameter
-               if (null == openingTimes) {
-                       // Throw NPE
-                       throw new NullPointerException("openingTimes is null");
-               } else if (openingTimes.isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("openingTimes is empty");
-               }
-
-               // Walk through whole list
-               for (final OpeningTime openingTime : openingTimes) {
-                       // Id should not be set
-                       if (openingTime.getOpeningId() != null) {
-                               // Abort here
-                               throw new IllegalStateException("openingTime.openingId is not null");
-                       }
-
-                       // Set created timestamp
-                       openingTime.setOpeningCreated(new Date());
-               }
-       }
-
-       /**
-        * Updates all contact's phone entry's created timestamps
-        * <p>
-        * @param contact Contact instance to update
-        */
-       protected void setAllPhoneEntriesCreated (final Contact contact) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllPhoneEntriesCreated: contact={0} - CALLED!", contact)); //NOI18N
-
-               // The contact instance must be valid
-               if (null == contact) {
-                       // Throw NPE
-                       throw new NullPointerException("contact is null"); //NOI18N
-               } else if (contact.getContactId() != null) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is unexpected.", contact.getContactId()));
-               }
-
-               // Get all phone instances
-               final DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
-               final DialableFaxNumber faxNumber = contact.getContactFaxNumber();
-               final DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1},mobileNumber={2}", landLineNumber, faxNumber, mobileNumber)); //NOI18N
-
-               // Is a phone number instance set?
-               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       landLineNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Is a fax number instance set?
-               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       faxNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Is a mobile number instance set?
-               if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for mobile number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       mobileNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace("setAllPhoneEntriesCreated: EXIT!"); //NOI18N
-       }
-
-       /**
-        * Updates all branch office's phone entry's created timestamps
-        * <p>
-        * @param branchOffice Branch office instance to update
-        */
-       protected void setAllPhoneEntriesCreated (final BranchOffice branchOffice) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllPhoneEntriesCreated: branchOffice={0} - CALLED!", branchOffice)); //NOI18N
-
-               // The contact instance must be valid
-               if (null == branchOffice) {
-                       // Throw NPE again
-                       throw new NullPointerException("branchOffice is null"); //NOI18N
-               } else if (branchOffice.getBranchId() != null) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("branchOffice.branchId={0} is unexpected.", branchOffice.getBranchId()));
-               }
-
-               // Get all phone instances
-               final DialableLandLineNumber landLineNumber = branchOffice.getBranchLandLineNumber();
-               final DialableFaxNumber faxNumber = branchOffice.getBranchFaxNumber();
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1}", landLineNumber, faxNumber)); //NOI18N
-
-               // Is a phone number instance set?
-               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       landLineNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Is a fax number instance set?
-               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       faxNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace("setAllPhoneEntriesCreated: EXIT!"); //NOI18N
-       }
-
-       /**
-        * Updates all branch office's phone entry's created timestamps
-        * <p>
-        * @param headquarter Headquarters instance to update
-        */
-       protected void setAllPhoneEntriesCreated (final Headquarter headquarter) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllPhoneEntriesCreated: headquarter={0} - CALLED!", headquarter)); //NOI18N
-
-               // The contact instance must be valid
-               if (null == headquarter) {
-                       // Throw NPE again
-                       throw new NullPointerException("headquarter is null"); //NOI18N
-               } else if (headquarter.getHeadquarterId() != null) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is unexpected.", headquarter.getHeadquarterId()));
-               }
-
-               // Get all phone instances
-               final DialableLandLineNumber landLineNumber = headquarter.getHeadquarterLandLineNumber();
-               final DialableFaxNumber faxNumber = headquarter.getHeadquarterFaxNumber();
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1}", landLineNumber, faxNumber)); //NOI18N
-
-               // Is a phone number instance set?
-               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       landLineNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Is a fax number instance set?
-               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       faxNumber.setPhoneEntryCreated(new Date());
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace("setAllPhoneEntriesCreated: EXIT!"); //NOI18N
-       }
-
-       /**
-        * Updates all company's phone entry's created timestamps
-        * <p>
-        * @param basicData Company basic data instance to update
-        */
-       protected void setAllPhoneEntriesCreated (final BasicData basicData) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllPhoneEntriesCreated: basicData={0} - CALLED!", basicData)); //NOI18N
-
-               // The contact instance must be valid
-               if (null == basicData) {
-                       // Throw NPE again
-                       throw new NullPointerException("basicData is null"); //NOI18N
-               } else if (basicData.getBasicDataId() != null) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("basicData.basicDataId={0} is unexpected.", basicData.getBasicDataId()));
-               }
-
-               // Get all phone instances
-               final DialableLandLineNumber landLineNumber = basicData.getCompanyLandLineNumber();
-               final DialableFaxNumber faxNumber = basicData.getCompanyFaxNumber();
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1}", landLineNumber, faxNumber)); //NOI18N
-
-               // Is a phone number instance set?
-               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       landLineNumber.setPhoneEntryCreated(new Date());
-
-                       // Set it back in basic data
-                       basicData.setCompanyLandLineNumber(landLineNumber);
-               }
-
-               // Is a fax number instance set?
-               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
-
-                       // Set updated timestamp
-                       faxNumber.setPhoneEntryCreated(new Date());
-
-                       // Set it back in basic data
-                       basicData.setCompanyFaxNumber(faxNumber);
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace("setAllPhoneEntriesCreated: EXIT!"); //NOI18N
-       }
-
-       /**
-        * Returns a detached instance from given mobile instance
-        * <p>
-        * @param mobileNumber  Mobile instance
-        * @param fetchedNumber Found mobile number in database
-        * <p>
-        * @return Detached instance
-        */
-       protected DialableMobileNumber getDetached (final DialableMobileNumber mobileNumber, final DialableMobileNumber fetchedNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: mobileNumber={0},fetchedNumber={1} - CALLED!", mobileNumber, fetchedNumber)); //NOI18N
-
-               // Should be valid
-               if (null == mobileNumber) {
-                       // Throw NPE
-                       throw new NullPointerException("mobileNumber is null"); //NOI18N
-               } else if (fetchedNumber.getPhoneId() == null) {
-                       // ..and again
-                       throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
-
-               // Init query instance
-               final DialableMobileNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
-
-               // Default is null
-               DialableMobileNumber detachedNumber = null;
-
-               // Is there a difference?
-               if (!PhoneUtils.isSameMobileNumber(mobileNumber, fetchedNumber)) {
-                       // Merge this entry
-                       detachedNumber = this.getEntityManager().merge(foundNumber);
-
-                       // @TODO Copy all
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
-
-               // Return it
-               return detachedNumber;
-       }
-
-       /**
-        * Returns a detached instance from given land-line instance
-        * <p>
-        * @param landLineNumber Land-line instance
-        * @param fetchedNumber  Found land-line number in database
-        * <p>
-        * @return Detached instance
-        */
-       protected DialableLandLineNumber getDetached (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: landLineNumber={0},fetchedNumber={1} - CALLED!", landLineNumber, fetchedNumber)); //NOI18N
-
-               // Should be valid
-               if (null == landLineNumber) {
-                       // Throw NPE
-                       throw new NullPointerException("landLineNumber is null"); //NOI18N
-               } else if (fetchedNumber.getPhoneId() == null) {
-                       // ..and again
-                       throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
-
-               // Init query instance
-               final DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
-
-               // Default is null
-               DialableLandLineNumber detachedNumber = null;
-
-               // Is there a difference?
-               if (!PhoneUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
-                       // Merge this entry
-                       detachedNumber = this.getEntityManager().merge(foundNumber);
-
-                       // @TODO Copy all
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
-
-               // Return it
-               return detachedNumber;
-       }
-
-       /**
-        * Returns a detached instance from given fax instance
-        * <p>
-        * @param faxNumber     Fax instance
-        * @param fetchedNumber Found fax number in database
-        * <p>
-        * @return Detached instance
-        */
-       protected DialableFaxNumber getDetached (final DialableFaxNumber faxNumber, final DialableFaxNumber fetchedNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: faxNumber={0},fetchedNumber={1} - CALLED!", faxNumber, fetchedNumber)); //NOI18N
-
-               // Should be valid
-               if (null == faxNumber) {
-                       // Throw NPE
-                       throw new NullPointerException("faxNumber is null"); //NOI18N
-               } else if (fetchedNumber.getPhoneId() == null) {
-                       // ..and again
-                       throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
-
-               // Init query instance
-               final DialableFaxNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
-
-               // Default is null
-               DialableFaxNumber detachedNumber = null;
-
-               // Is there a difference?
-               if (!PhoneUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
-                       // Merge this entry
-                       detachedNumber = this.getEntityManager().merge(foundNumber);
-
-                       // @TODO Copy all
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
-
-               // Return it
-               return detachedNumber;
-       }
-
-       /**
-        * Returns a managed instance from given mobile number
-        * <p>
-        * @param mobileNumber  Mobile instance
-        * @param fetchedNumber Found mobile number in database
-        * <p>
-        * @return Managed instance
-        */
-       protected DialableMobileNumber getManaged (final DialableMobileNumber mobileNumber, final DialableMobileNumber fetchedNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: mobileNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), mobileNumber, fetchedNumber)); //NOI18N
-
-               // Should be valid
-               if (null == mobileNumber) {
-                       // Throw NPE
-                       throw new NullPointerException("mobileNumber is null"); //NOI18N
-               } else if (null == fetchedNumber) {
-                       // Throw NPE again
-                       throw new NullPointerException("fetchedNumber is null"); //NOI18N
-               } else if (fetchedNumber.getPhoneId() == null) {
-                       // ..and again
-                       throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
-
-               // Init query instance
-               final DialableMobileNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
-
-               // Default is null
-               DialableMobileNumber detachedNumber = null;
-
-               // Is there a difference?
-               if (!PhoneUtils.isSameMobileNumber(mobileNumber, fetchedNumber)) {
-                       // Merge this entry
-                       detachedNumber = this.getEntityManager().merge(foundNumber);
-
-                       // @TODO Copy all
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: detachedNumber={1} - EXIT!", this.getClass().getSimpleName(), detachedNumber)); //NOI18N
-
-               // Return it
-               return detachedNumber;
-       }
-
-       /**
-        * Returns a managed instance from given land-line number
-        * <p>
-        * @param landLineNumber Land-line instance
-        * @param fetchedNumber  Found land-line number in database
-        * <p>
-        * @return Managed instance
-        */
-       protected DialableLandLineNumber getManaged (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: landLineNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), landLineNumber, fetchedNumber)); //NOI18N
-
-               // Should be valid
-               if (null == landLineNumber) {
-                       // Throw NPE
-                       throw new NullPointerException("landLineNumber is null"); //NOI18N
-               } else if (null == fetchedNumber) {
-                       // Throw NPE again
-                       throw new NullPointerException("fetchedNumber is null"); //NOI18N
-               } else if (fetchedNumber.getPhoneId() == null) {
-                       // ..and again
-                       throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
-
-               // Init query instance
-               final DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
-
-               // Default is null
-               DialableLandLineNumber detachedNumber = null;
-
-               // Is there a difference?
-               if (!PhoneUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
-                       // Merge this entry
-                       detachedNumber = this.getEntityManager().merge(foundNumber);
-
-                       // @TODO Copy all
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), detachedNumber)); //NOI18N
-
-               // Return it
-               return detachedNumber;
-       }
-
-       /**
-        * Returns a managed instance from given fax number
-        * <p>
-        * @param faxNumber     Fax instance
-        * @param fetchedNumber Found fax number in database
-        * <p>
-        * @return Managed instance
-        */
-       protected DialableFaxNumber getManaged (final DialableFaxNumber faxNumber, final DialableFaxNumber fetchedNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: faxNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), faxNumber, fetchedNumber)); //NOI18N
-
-               // Should be valid
-               if (null == faxNumber) {
-                       // Throw NPE
-                       throw new NullPointerException("faxNumber is null"); //NOI18N
-               } else if (null == fetchedNumber) {
-                       // Throw NPE again
-                       throw new NullPointerException("fetchedNumber is null"); //NOI18N
-               } else if (fetchedNumber.getPhoneId() == null) {
-                       // ..and again
-                       throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
-
-               // Init query instance
-               final DialableFaxNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
-
-               // Default is null
-               DialableFaxNumber detachedNumber = null;
-
-               // Is there a difference?
-               if (!PhoneUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
-                       // Merge this entry
-                       detachedNumber = this.getEntityManager().merge(foundNumber);
-
-                       // @TODO Copy all
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), detachedNumber)); //NOI18N
-
-               // Return it
-               return detachedNumber;
-       }
-
-       /**
-        * Merges given contact's data
-        * <p>
-        * @param detachedContact Contact instance to merge
-        * <p>
-        * @return Detached contact instance
-        */
-       protected Contact mergeContactData (final Contact detachedContact) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactData: contact={1} - CALLED!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
-
-               // The contact instance must be valid
-               if (null == detachedContact) {
-                       // Throw NPE again
-                       throw new NullPointerException("detachedContact is null"); //NOI18N
-               } else if (detachedContact.getContactId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
-               } else if (detachedContact.getContactId() < 1) {
-                       // Not valid
-                       throw new IllegalStateException(MessageFormat.format("{0}.detachedContact.contactId={1} is not valid.", this.getClass().getSimpleName(), detachedContact.getContactId())); //NOI18N
-               }
-
-               // Set updated timestamp
-               detachedContact.setContactUpdated(new Date());
-
-               // Get contact from it and find it
-               final Contact foundContact = this.getEntityManager().find(detachedContact.getClass(), detachedContact.getContactId());
-
-               // Should be found
-               assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", detachedContact.getContactId()); //NOI18N
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateUserPersonalData: foundContact.contactId={1}", this.getClass().getSimpleName(), foundContact.getContactId())); //NOI18N
-
-               // Is a fax number set?
-               if (detachedContact.getContactFaxNumber() instanceof DialableFaxNumber) {
-                       // Make fax numbers managed
-                       foundContact.setContactFaxNumber(this.getManaged(detachedContact.getContactFaxNumber(), detachedContact.getContactFaxNumber()));
-               }
-
-               // Is a land-line number set?
-               if (detachedContact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
-                       // Make land-line numbers managed
-                       foundContact.setContactLandLineNumber(this.getManaged(detachedContact.getContactLandLineNumber(), detachedContact.getContactLandLineNumber()));
-               }
-
-               // Is a mobile number set?
-               if (detachedContact.getContactMobileNumber() instanceof DialableMobileNumber) {
-                       // Make mobile numbers managed
-                       foundContact.setContactMobileNumber(this.getManaged(detachedContact.getContactMobileNumber(), detachedContact.getContactMobileNumber()));
-               }
-
-               // Merge contact instance
-               final Contact managedContact = this.getEntityManager().merge(foundContact);
-
-               // Copy all
-               Contacts.copyAll(detachedContact, managedContact);
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactData: foundContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
-
-               // Return detached contact
-               return managedContact;
-       }
-
-       /**
-        * Merges given (detached) contact's mobile, land-line and fax numbers
-        * <p>
-        * @param detachedContact Detached contact instance
-        */
-       protected void mergeContactsMobileLandLineFaxNumbers (final Contact detachedContact) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactsMobileLandLineFaxNumbers: detachedContact={1} - CALLED!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
-
-               // The contact instance must be valid
-               if (null == detachedContact) {
-                       // Throw NPE again
-                       throw new NullPointerException("detachedContact is null"); //NOI18N
-               } else if (detachedContact.getContactId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
-               } else if (detachedContact.getContactId() < 1) {
-                       // Not valid
-                       throw new IllegalStateException(MessageFormat.format("{0}.detachedContact.contactId={1} is not valid.", this.getClass().getSimpleName(), detachedContact.getContactId())); //NOI18N
-               }
-
-               // Get all instances
-               final DialableMobileNumber mobile = detachedContact.getContactMobileNumber();
-               final DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber();
-               final DialableFaxNumber fax = detachedContact.getContactFaxNumber();
-
-               // Is there a  mobile instance set?
-               if (mobile instanceof DialableMobileNumber) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: mobile.phoneId={0} is being updated ...", mobile.getPhoneId())); //NOI18N
-
-                       // Then find it, too
-                       final DialableMobileNumber foundMobile = this.getEntityManager().find(mobile.getClass(), mobile.getPhoneId());
-
-                       // Should be there
-                       assert (foundMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", foundMobile.getPhoneId()); //NOI18N
-
-                       // Then merge it, too
-                       final DialableMobileNumber managedMobile = this.getEntityManager().merge(foundMobile);
-
-                       // Should be there
-                       assert (managedMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", managedMobile.getPhoneId()); //NOI18N
-
-                       // Copy all
-                       MobileNumbers.copyAll(detachedContact.getContactMobileNumber(), managedMobile);
-
-                       // Set it back
-                       detachedContact.setContactMobileNumber(managedMobile);
-               }
-
-               // Is there a  fax instance set?
-               if (fax instanceof DialableFaxNumber) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: fax.phoneId={0} is being updated ...", fax.getPhoneId())); //NOI18N
-
-                       // Then find it, too
-                       final DialableFaxNumber foundFax = this.getEntityManager().find(fax.getClass(), fax.getPhoneId());
-
-                       // Should be there
-                       assert (foundFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", foundFax.getPhoneId()); //NOI18N
-
-                       // Then merge it, too
-                       final DialableFaxNumber managedFax = this.getEntityManager().merge(foundFax);
-
-                       // Should be there
-                       assert (managedFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", managedFax.getPhoneId()); //NOI18N
-
-                       // Copy all
-                       FaxNumbers.copyAll(detachedContact.getContactFaxNumber(), managedFax);
-
-                       // Set it back
-                       detachedContact.setContactFaxNumber(managedFax);
-               }
-
-               // Is there a  fax instance set?
-               if (landLine instanceof DialableLandLineNumber) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: landLine.phoneId={0} is being updated ...", landLine.getPhoneId())); //NOI18N
-
-                       // Then find it, too
-                       final DialableLandLineNumber foundLandLine = this.getEntityManager().find(landLine.getClass(), landLine.getPhoneId());
-
-                       // Should be there
-                       assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); //NOI18N
-
-                       // Then merge it, too
-                       final DialableLandLineNumber managedLandLine = this.getEntityManager().merge(foundLandLine);
-
-                       // Should be there
-                       assert (managedLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", managedLandLine.getPhoneId()); //NOI18N
-
-                       // Copy all
-                       LandLineNumbers.copyAll(detachedContact.getContactLandLineNumber(), managedLandLine);
-
-                       // Set it back
-                       detachedContact.setContactLandLineNumber(managedLandLine);
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace("mergeContactsMobileLandLineFaxNumbers: EXIT!"); //NOI18N
-       }
-
-       /**
-        * Sends an email with given subject line, template name to given recipient
-        * and user data
-        * <p>
-        * @param subjectLine    Subject line
-        * @param templateName   Template name
-        * @param user           User instance
-        * @param baseUrl        Base URL
-        * @param randomPassword A randomly-generated password or NULL if user had
-        *                       to enter it.
-        */
-       protected void sendEmail (final String subjectLine, final String templateName, final User user, final String baseUrl, final String randomPassword) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmail: subjectLine={0},templateName={1},user={2},baseUrl={3} - CALLED!", subjectLine, templateName, user, baseUrl)); //NOI18N
-
-               // All should be set
-               if (null == subjectLine) {
-                       // Throw NPE
-                       throw new NullPointerException("subjectLine is null"); //NOI18N
-               } else if (subjectLine.isEmpty()) {
-                       // No subject line
-                       throw new IllegalArgumentException("subjectLine is empty"); //NOI18N
-               } else if (null == templateName) {
-                       // Throw NPE
-                       throw new NullPointerException("templateName is null"); //NOI18N
-               } else if (templateName.isEmpty()) {
-                       // No template name
-                       throw new IllegalArgumentException("templateName is empty"); //NOI18N
-               } else if (null == user) {
-                       // Throw NPE
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Not valid number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid.", user.getUserId())); //NOI18N
-               } else if (user.getUserName() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userName is null"); //NOI18N
-               } else if (user.getUserName().isEmpty()) {
-                       // Empty string
-                       throw new IllegalArgumentException("user.userName is empty"); //NOI18N
-               } else if (user.getUserAccountStatus() == null) {
-                       // Throw NPE
-                       throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
-               } else if (user.getUserContact() == null) {
-                       // Throw it again
-                       throw new NullPointerException("user.userContact is null"); //NOI18N
-               } else if (user.getUserContact().getContactId() == null) {
-                       // .. and again
-                       throw new NullPointerException("user.userContact.contactId is null"); //NOI18N
-               } else if (user.getUserContact().getContactId() < 1) {
-                       // Invalid id
-                       throw new IllegalArgumentException(MessageFormat.format("user.userContact.contactId={0} is invalid", user.getUserContact().getContactId())); //NOI18N
-               } else if (user.getUserContact().getContactPersonalTitle() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userContact.contactPersonalTitle is null"); //NOI18N
-               } else if (user.getUserLocale() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userLocale is null"); //NOI18N
-               } else if (this.getSession() == null) {
-                       // Throw NPE
-                       throw new NullPointerException("this.session is not set. Have you forgotten to call super(String, String) and called only super() ?"); //NOI18N
-               }
-
-               // Set all values
-               final Properties variables = Users.getAllUserFields(user);
-
-               // Set base URL and random password
-               variables.put("baseUrl", baseUrl); //NOI18N
-               variables.put("randomPassword", ""); //NOI18N
-
-               // Is the random password set?
-               if ((randomPassword instanceof String) && (!randomPassword.isEmpty())) {
-                       variables.put("randomPassword", randomPassword); //NOI18N
-               }
-
-               // Init addresss
-               final Address recipientAddress;
-
-               try {
-                       // Create email address and set
-                       recipientAddress = new InternetAddress(user.getUserContact().getContactEmailAddress());
-               } catch (final AddressException ex) {
-                       // Throw again
-                       throw new EJBException(ex);
-               }
-
-               // Prepare mail wrapper
-               // @TODO Language from message bundle
-               final WrapableEmailDelivery emailWrapper = new EmailDeliveryWrapper(recipientAddress, subjectLine, templateName, variables, user.getUserLocale());
-
-               try {
-                       // Send out email change
-                       final ObjectMessage message = this.getSession().createObjectMessage();
-                       message.setObject(emailWrapper);
-
-                       // Send message
-                       this.sendMessage(message);
-               } catch (final JMSException ex) {
-                       // Throw again
-                       throw new EJBException(ex);
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace("sendEmail: EXIT!"); //NOI18N
-       }
-
-       /**
-        * Updates all contact's phone instances from other contact, both contacts
-        * should be the same.
-        * <p>
-        * @param contact Contact to set instances
-        * @param other   Other contact to get instances from
-        */
-       protected void setAllContactPhoneEntries (final Contact contact, final Contact other) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntries: contact={1},other={2} - CALLED!", this.getClass().getSimpleName(), contact, other)); //NOI18N
-
-               // Both must be the same and not null
-               if (null == contact) {
-                       // Throw NPE
-                       throw new NullPointerException("contact is null"); //NOI18N
-               } else if (null == other) {
-                       // Throw NPE
-                       throw new NullPointerException("other is null"); //NOI18N
-               } else if (!Objects.equals(contact, other)) {
-                       // Not same instances
-                       throw new IllegalArgumentException(MessageFormat.format("contact={0} and other={1} are not equal!", contact, other)); //NOI18N
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactMobileNumber={0}", other.getContactMobileNumber())); //NOI18N
-
-               // Is other mobile not set?
-               if ((other.getContactMobileNumber() == null) || (PhoneUtils.isSameMobileNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying mobile entry ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Is the fax number set?
-                       if (other.getContactMobileNumber() instanceof DialableMobileNumber) {
-                               // Copy mobile number
-                               contact.setContactMobileNumber(this.getManaged(other.getContactMobileNumber(), contact.getContactMobileNumber()));
-                       } else {
-                               // Null it
-                               contact.setContactMobileNumber(null);
-                       }
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactLandLineNumber={0}", other.getContactLandLineNumber())); //NOI18N
-
-               // Is other mobile not set?
-               if ((other.getContactLandLineNumber() == null) || (PhoneUtils.isSameLandLineNumber(contact.getContactLandLineNumber(), other.getContactLandLineNumber()))) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying land-line entry ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Is the land-line number set?
-                       if (other.getContactLandLineNumber() instanceof DialableLandLineNumber) {
-                               // Copy land-line number
-                               contact.setContactLandLineNumber(this.getManaged(other.getContactLandLineNumber(), contact.getContactLandLineNumber()));
-                       } else {
-                               // Null it
-                               contact.setContactLandLineNumber(null);
-                       }
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactFaxNumber={1}", this.getClass().getSimpleName(), other.getContactFaxNumber())); //NOI18N
-
-               // Is other mobile not set?
-               if ((other.getContactFaxNumber() == null) || (PhoneUtils.isSameFaxNumber(contact.getContactFaxNumber(), other.getContactFaxNumber()))) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying fax entry ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Is the fax number set?
-                       if (other.getContactFaxNumber() instanceof DialableFaxNumber) {
-                               // Copy fax number
-                               contact.setContactFaxNumber(this.getManaged(other.getContactFaxNumber(), contact.getContactFaxNumber()));
-                       } else {
-                               // Null it
-                               contact.setContactFaxNumber(null);
-                       }
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntries: EXIT!", this.getClass().getSimpleName())); //NOI18N
-       }
-
-       /**
-        * Updates all contact's phone entry's updated timestamps
-        * <p>
-        * @param contact            Contact instance to update
-        * @param isMobileUnlinked   Whether a mobile entry has been unlinked in
-        *                           contact instance
-        * @param isLandlineUnlinked Whether a land-line entry has been unlinked in
-        *                           contact instance
-        * @param isFaxUnlinked      Whether a fax entry has been unlinked in
-        *                           contact instance
-        */
-       protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: contact={1},isMobileUnlinked={2},isLandlineUnlinked={3},isFaxUnlinked={4} - CALLED", this.getClass().getSimpleName(), contact, isMobileUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
-
-               // The contact instance must be valid
-               if (null == contact) {
-                       // Throw NPE again
-                       throw new NullPointerException("contact is null"); //NOI18N
-               } else if (contact.getContactId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
-               } else if (contact.getContactId() < 1) {
-                       // Not valid
-                       throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
-               }
-
-               // Get all phone instances
-               final DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
-               final DialableFaxNumber faxNumber = contact.getContactFaxNumber();
-               final DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
-
-               // Flags and instances must be constistent
-               if (isMobileUnlinked && mobileNumber instanceof DialableMobileNumber) {
-                       // Bad state
-                       throw new IllegalStateException("isCellPhoneUnlinked is TRUE, but mobileNumber is set."); //NOI18N
-               } else if (isLandlineUnlinked && landLineNumber instanceof DialableLandLineNumber) {
-                       // Bad state
-                       throw new IllegalStateException("isLandlineUnlinked is TRUE, but landLineNumber is set."); //NOI18N
-               } else if (isFaxUnlinked && faxNumber instanceof DialableFaxNumber) {
-                       // Bad state
-                       throw new IllegalStateException("isFaxUnlinked is TRUE, but faxNumber is set."); //NOI18N
-               }
-
-               // Is a phone number instance set?
-               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() instanceof Long) && (landLineNumber.getPhoneId() > 0)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for land-line number ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Set updated timestamp
-                       landLineNumber.setPhoneEntryUpdated(new Date());
-               }
-
-               // Is a fax number instance set?
-               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() instanceof Long) && (faxNumber.getPhoneId() > 0)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for fax number ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Set updated timestamp
-                       faxNumber.setPhoneEntryUpdated(new Date());
-               }
-
-               // Is a mobile number instance set?
-               if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() instanceof Long) && (mobileNumber.getPhoneId() > 0)) {
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for mobile number ...", this.getClass().getSimpleName())); //NOI18N
-
-                       // Set updated timestamp
-                       mobileNumber.setPhoneEntryUpdated(new Date());
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: EXIT!", this.getClass().getSimpleName())); //NOI18N
-       }
-
-}
diff --git a/src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java b/src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java
new file mode 100644 (file)
index 0000000..4b1714a
--- /dev/null
@@ -0,0 +1,1474 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.enterprise;
+
+import java.text.MessageFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.Properties;
+import javax.ejb.EJBException;
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.mail.Address;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontacts.model.contact.Contacts;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
+import org.mxchange.jcontactsbusiness.model.department.Department;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
+import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
+import org.mxchange.jcoreee.bean.ejb.BaseEnterpriseBean;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jmailee.model.delivery.wrapper.EmailDeliveryWrapper;
+import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jphone.utils.PhoneUtils;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.Users;
+
+/**
+ * A helper class for beans that access the database.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 12_895_410_275_811_963L;
+
+       /**
+        * Protected constructor
+        */
+       protected BaseJobsEnterpriseBean () {
+               // Call super constructor
+               super();
+       }
+
+       /**
+        * Constructor with queue factory JNDI and queue JNDI names
+        * <p>
+        * @param factoryJndi JNDI name for queue factory
+        * @param queueJndi   JNDI name for email queue
+        */
+       protected BaseJobsEnterpriseBean (final String factoryJndi, final String queueJndi) {
+               // Call super constructor
+               super(factoryJndi, queueJndi);
+       }
+
+       /**
+        * Get back a managed instance from given contact
+        * <p>
+        * @param contact Unmanaged/detached contact instance
+        * <p>
+        * @return Managed contact instance
+        */
+       protected Contact createManaged (final Contact contact) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
+
+               // user should not be null
+               if (null == contact) {
+                       // Abort here
+                       throw new NullPointerException("contact is null"); //NOI18N
+               } else if (contact.getContactId() == null) {
+                       // Id is set
+                       throw new NullPointerException("contact.contactId is null"); //NOI18N
+               } else if (contact.getContactId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Contact managedContact = this.getEntityManager().find(contact.getClass(), contact.getContactId());
+
+               // Should be there
+               assert (managedContact instanceof Contact) : "managedContact is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
+
+               // Return it
+               return managedContact;
+       }
+
+       /**
+        * Get back a managed instance from given country
+        * <p>
+        * @param country Unmanaged/detached country instance
+        * <p>
+        * @return Managed country instance
+        */
+       protected Country createManaged (final Country country) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: country={1} - CALLED!", this.getClass().getSimpleName(), country)); //NOI18N
+
+               // user should not be null
+               if (null == country) {
+                       // Abort here
+                       throw new NullPointerException("country is null"); //NOI18N
+               } else if (country.getCountryId() == null) {
+                       // Id is set
+                       throw new NullPointerException("country.countryId is null"); //NOI18N
+               } else if (country.getCountryId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("country.countryId={0} is invalid", country.getCountryId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Country managedCountry = this.getEntityManager().find(country.getClass(), country.getCountryId());
+
+               // Should be there
+               assert (managedCountry instanceof Country) : "managedCountry is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedCountry={1} - EXIT!", this.getClass().getSimpleName(), managedCountry)); //NOI18N
+
+               // Return it
+               return managedCountry;
+       }
+
+       /**
+        * Get back a managed instance from given basic data
+        * <p>
+        * @param basicData Unmanaged/detached basic data instance
+        * <p>
+        * @return Managed basic data instance
+        */
+       protected BasicData createManaged (final BasicData basicData) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: basicData={1} - CALLED!", this.getClass().getSimpleName(), basicData)); //NOI18N
+
+               // user should not be null
+               if (null == basicData) {
+                       // Abort here
+                       throw new NullPointerException("basicData is null"); //NOI18N
+               } else if (basicData.getBasicDataId() == null) {
+                       // Id is set
+                       throw new NullPointerException("basicData.basicDataId is null"); //NOI18N
+               } else if (basicData.getBasicDataId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("basicData.basicDataId={0} is invalid", basicData.getBasicDataId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final BasicData managedBasicData = this.getEntityManager().find(basicData.getClass(), basicData.getBasicDataId());
+
+               // Should be there
+               assert (managedBasicData instanceof BasicData) : "managedBasicData is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedBasicData={1} - EXIT!", this.getClass().getSimpleName(), managedBasicData)); //NOI18N
+
+               // Return it
+               return managedBasicData;
+       }
+
+       /**
+        * Get back a managed instance from given branch office
+        * <p>
+        * @param headquarter Unmanaged/detached branch office instance
+        * <p>
+        * @return Managed basic data instance
+        */
+       protected BranchOffice createManaged (final BranchOffice headquarter) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
+
+               // user should not be null
+               if (null == headquarter) {
+                       // Abort here
+                       throw new NullPointerException("headquarter is null"); //NOI18N
+               } else if (headquarter.getBranchId() == null) {
+                       // Id is set
+                       throw new NullPointerException("headquarter.headquarterId is null"); //NOI18N
+               } else if (headquarter.getBranchId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is invalid", headquarter.getBranchId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final BranchOffice managedBranchOffice = this.getEntityManager().find(headquarter.getClass(), headquarter.getBranchId());
+
+               // Should be there
+               assert (managedBranchOffice instanceof BranchOffice) : "managedBranchOffice is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedBranchOffice={1} - EXIT!", this.getClass().getSimpleName(), managedBranchOffice)); //NOI18N
+
+               // Return it
+               return managedBranchOffice;
+       }
+
+       /**
+        * Get back a managed instance from given department
+        * <p>
+        * @param department Unmanaged/detached department instance
+        * <p>
+        * @return Managed department instance
+        */
+       protected Department createManaged (final Department department) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: department={1} - CALLED!", this.getClass().getSimpleName(), department)); //NOI18N
+
+               // user should not be null
+               if (null == department) {
+                       // Abort here
+                       throw new NullPointerException("department is null"); //NOI18N
+               } else if (department.getDepartmentId() == null) {
+                       // Id is set
+                       throw new NullPointerException("department.departmentId is null"); //NOI18N
+               } else if (department.getDepartmentId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("department.departmentId={0} is invalid", department.getDepartmentId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Department managedDepartment = this.getEntityManager().find(department.getClass(), department.getDepartmentId());
+
+               // Should be there
+               assert (managedDepartment instanceof Department) : "managedDepartment is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedDepartment={1} - EXIT!", this.getClass().getSimpleName(), managedDepartment)); //NOI18N
+
+               // Return it
+               return managedDepartment;
+       }
+
+       /**
+        * Get back a managed instance from given employee
+        * <p>
+        * @param employee Unmanaged/detached employee instance
+        * <p>
+        * @return Managed employee instance
+        */
+       protected Employable createManaged (final Employable employee) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: employee={1} - CALLED!", this.getClass().getSimpleName(), employee)); //NOI18N
+
+               // user should not be null
+               if (null == employee) {
+                       // Abort here
+                       throw new NullPointerException("employee is null"); //NOI18N
+               } else if (employee.getEmployeeId() == null) {
+                       // Id is set
+                       throw new NullPointerException("employee.employeeId is null"); //NOI18N
+               } else if (employee.getEmployeeId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeId={0} is invalid", employee.getEmployeeId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Employable managedEmployee = this.getEntityManager().find(employee.getClass(), employee.getEmployeeId());
+
+               // Should be there
+               assert (managedEmployee instanceof Employable) : "managedEmployee is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedEmployee={1} - EXIT!", this.getClass().getSimpleName(), managedEmployee)); //NOI18N
+
+               // Return it
+               return managedEmployee;
+       }
+
+       /**
+        * Get back a managed instance from given jobPosition
+        * <p>
+        * @param jobPosition Unmanaged/detached job position instance
+        * <p>
+        * @return Managed job position instance
+        */
+       protected HireableJobPosition createManaged (final HireableJobPosition jobPosition) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: jobPosition={1} - CALLED!", this.getClass().getSimpleName(), jobPosition)); //NOI18N
+
+               // user should not be null
+               if (null == jobPosition) {
+                       // Abort here
+                       throw new NullPointerException("jobPosition is null"); //NOI18N
+               } else if (jobPosition.getJobPositionId() == null) {
+                       // Id is set
+                       throw new NullPointerException("jobPosition.jobPositionId is null"); //NOI18N
+               } else if (jobPosition.getJobPositionId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("jobPosition.jobPositionId={0} is invalid", jobPosition.getJobPositionId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final HireableJobPosition managedJobPosition = this.getEntityManager().find(jobPosition.getClass(), jobPosition.getJobPositionId());
+
+               // Should be there
+               assert (managedJobPosition instanceof HireableJobPosition) : "managedJobPosition is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedJobPosition={1} - EXIT!", this.getClass().getSimpleName(), managedJobPosition)); //NOI18N
+
+               // Return it
+               return managedJobPosition;
+       }
+
+       /**
+        * Get back a managed instance from given headquarter
+        * <p>
+        * @param headquarter Unmanaged/detached headquarter instance
+        * <p>
+        * @return Managed basic data instance
+        */
+       protected Headquarter createManaged (final Headquarter headquarter) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
+
+               // user should not be null
+               if (null == headquarter) {
+                       // Abort here
+                       throw new NullPointerException("headquarter is null"); //NOI18N
+               } else if (headquarter.getHeadquarterId() == null) {
+                       // Id is set
+                       throw new NullPointerException("headquarter.headquarterId is null"); //NOI18N
+               } else if (headquarter.getHeadquarterId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is invalid", headquarter.getHeadquarterId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Headquarter managedHeadquarter = this.getEntityManager().find(headquarter.getClass(), headquarter.getHeadquarterId());
+
+               // Should be there
+               assert (managedHeadquarter instanceof Headquarter) : "managedHeadquarter is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedHeadquarter={1} - EXIT!", this.getClass().getSimpleName(), managedHeadquarter)); //NOI18N
+
+               // Return it
+               return managedHeadquarter;
+       }
+
+       /**
+        * Get back a managed instance from given mobile provider
+        * <p>
+        * @param mobileProvider Unmanaged/detached mobile provider instance
+        * <p>
+        * @return Managed mobile provider instance
+        */
+       protected MobileProvider createManaged (final MobileProvider mobileProvider) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: mobileProvider={1} - CALLED!", this.getClass().getSimpleName(), mobileProvider)); //NOI18N
+
+               // user should not be null
+               if (null == mobileProvider) {
+                       // Abort here
+                       throw new NullPointerException("mobileProvider is null"); //NOI18N
+               } else if (mobileProvider.getProviderId() == null) {
+                       // Id is set
+                       throw new NullPointerException("mobileProvider.providerId is null"); //NOI18N
+               } else if (mobileProvider.getProviderId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("mobileProvider.providerId={0} is invalid", mobileProvider.getProviderId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final MobileProvider managedMobileProvider = this.getEntityManager().find(mobileProvider.getClass(), mobileProvider.getProviderId());
+
+               // Should be there
+               assert (managedMobileProvider instanceof MobileProvider) : "managedMobileProvider is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedMobileProvider={1} - EXIT!", this.getClass().getSimpleName(), managedMobileProvider)); //NOI18N
+
+               // Return it
+               return managedMobileProvider;
+       }
+
+       /**
+        * Get back a managed instance from given user
+        * <p>
+        * @param user Unmanaged/detached user instance
+        * <p>
+        * @return Managed user instance
+        */
+       protected User createManaged (final User user) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
+
+               // user should not be null
+               if (null == user) {
+                       // Abort here
+                       throw new NullPointerException("user is null"); //NOI18N
+               } else if (user.getUserId() == null) {
+                       // Id is set
+                       throw new NullPointerException("user.userId is null"); //NOI18N
+               } else if (user.getUserId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is invalid", user.getUserId())); //NOI18N
+               } else if (user.getUserContact() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userContact is null"); //NOI18N
+               } else if (user.getUserContact().getContactId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userContact.contactId is null"); //NOI18N
+               } else if (user.getUserContact().getContactId() < 1) {
+                       // Not valid id number
+                       throw new IllegalArgumentException(MessageFormat.format("user.userContact.contactId={0} is not valid", user.getUserContact().getContactId())); //NOI18N#
+               }
+
+               // Try to find it (should be there)
+               final User managedUser = this.getEntityManager().find(user.getClass(), user.getUserId());
+
+               // Should be there
+               assert (managedUser instanceof User) : "managedUser is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N
+
+               // Return it
+               return managedUser;
+       }
+
+       /**
+        * Updates all contact's phone entry's created timestamps
+        * <p>
+        * @param contact Contact instance to update
+        */
+       protected void setAllContactPhoneEntriesCreated (final Contact contact) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
+
+               // The contact instance must be valid
+               if (null == contact) {
+                       // Throw NPE again
+                       throw new NullPointerException("contact is null"); //NOI18N
+               }
+
+               // Get all phone instances
+               final DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
+               final DialableFaxNumber faxNumber = contact.getContactFaxNumber();
+               final DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: landLineNumber={1},faxNumber={2},mobileNumber={3}", this.getClass().getSimpleName(), landLineNumber, faxNumber, mobileNumber)); //NOI18N
+
+               // Is a phone number instance set?
+               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for land-line number ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Set updated timestamp
+                       landLineNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Is a fax number instance set?
+               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for fax number ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Set updated timestamp
+                       faxNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Is a mobile number instance set?
+               if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for mobile number ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Set updated timestamp
+                       mobileNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: EXIT!", this.getClass().getSimpleName())); //NOI18N
+       }
+
+       /**
+        * Sets created timestamp on all opening times.
+        * <p>
+        * @param openingTimes Opening times list
+        * <p>
+        * @throws NullPointerException If given list is null
+        * @throws IllegalArgumentException If given list is empty
+        * @throws IllegalStateException If openingId is not null
+        */
+       protected void setAllOpeningTimesCreated (final List<OpeningTime> openingTimes) {
+               // Validate parameter
+               if (null == openingTimes) {
+                       // Throw NPE
+                       throw new NullPointerException("openingTimes is null");
+               } else if (openingTimes.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("openingTimes is empty");
+               }
+
+               // Walk through whole list
+               for (final OpeningTime openingTime : openingTimes) {
+                       // Id should not be set
+                       if (openingTime.getOpeningId() != null) {
+                               // Abort here
+                               throw new IllegalStateException("openingTime.openingId is not null");
+                       }
+
+                       // Set created timestamp
+                       openingTime.setOpeningCreated(new Date());
+               }
+       }
+
+       /**
+        * Updates all contact's phone entry's created timestamps
+        * <p>
+        * @param contact Contact instance to update
+        */
+       protected void setAllPhoneEntriesCreated (final Contact contact) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllPhoneEntriesCreated: contact={0} - CALLED!", contact)); //NOI18N
+
+               // The contact instance must be valid
+               if (null == contact) {
+                       // Throw NPE
+                       throw new NullPointerException("contact is null"); //NOI18N
+               } else if (contact.getContactId() != null) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is unexpected.", contact.getContactId()));
+               }
+
+               // Get all phone instances
+               final DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
+               final DialableFaxNumber faxNumber = contact.getContactFaxNumber();
+               final DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1},mobileNumber={2}", landLineNumber, faxNumber, mobileNumber)); //NOI18N
+
+               // Is a phone number instance set?
+               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       landLineNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Is a fax number instance set?
+               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       faxNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Is a mobile number instance set?
+               if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for mobile number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       mobileNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace("setAllPhoneEntriesCreated: EXIT!"); //NOI18N
+       }
+
+       /**
+        * Updates all branch office's phone entry's created timestamps
+        * <p>
+        * @param branchOffice Branch office instance to update
+        */
+       protected void setAllPhoneEntriesCreated (final BranchOffice branchOffice) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllPhoneEntriesCreated: branchOffice={0} - CALLED!", branchOffice)); //NOI18N
+
+               // The contact instance must be valid
+               if (null == branchOffice) {
+                       // Throw NPE again
+                       throw new NullPointerException("branchOffice is null"); //NOI18N
+               } else if (branchOffice.getBranchId() != null) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("branchOffice.branchId={0} is unexpected.", branchOffice.getBranchId()));
+               }
+
+               // Get all phone instances
+               final DialableLandLineNumber landLineNumber = branchOffice.getBranchLandLineNumber();
+               final DialableFaxNumber faxNumber = branchOffice.getBranchFaxNumber();
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1}", landLineNumber, faxNumber)); //NOI18N
+
+               // Is a phone number instance set?
+               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       landLineNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Is a fax number instance set?
+               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       faxNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace("setAllPhoneEntriesCreated: EXIT!"); //NOI18N
+       }
+
+       /**
+        * Updates all branch office's phone entry's created timestamps
+        * <p>
+        * @param headquarter Headquarters instance to update
+        */
+       protected void setAllPhoneEntriesCreated (final Headquarter headquarter) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllPhoneEntriesCreated: headquarter={0} - CALLED!", headquarter)); //NOI18N
+
+               // The contact instance must be valid
+               if (null == headquarter) {
+                       // Throw NPE again
+                       throw new NullPointerException("headquarter is null"); //NOI18N
+               } else if (headquarter.getHeadquarterId() != null) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is unexpected.", headquarter.getHeadquarterId()));
+               }
+
+               // Get all phone instances
+               final DialableLandLineNumber landLineNumber = headquarter.getHeadquarterLandLineNumber();
+               final DialableFaxNumber faxNumber = headquarter.getHeadquarterFaxNumber();
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1}", landLineNumber, faxNumber)); //NOI18N
+
+               // Is a phone number instance set?
+               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       landLineNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Is a fax number instance set?
+               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       faxNumber.setPhoneEntryCreated(new Date());
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace("setAllPhoneEntriesCreated: EXIT!"); //NOI18N
+       }
+
+       /**
+        * Updates all company's phone entry's created timestamps
+        * <p>
+        * @param basicData Company basic data instance to update
+        */
+       protected void setAllPhoneEntriesCreated (final BasicData basicData) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("setAllPhoneEntriesCreated: basicData={0} - CALLED!", basicData)); //NOI18N
+
+               // The contact instance must be valid
+               if (null == basicData) {
+                       // Throw NPE again
+                       throw new NullPointerException("basicData is null"); //NOI18N
+               } else if (basicData.getBasicDataId() != null) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("basicData.basicDataId={0} is unexpected.", basicData.getBasicDataId()));
+               }
+
+               // Get all phone instances
+               final DialableLandLineNumber landLineNumber = basicData.getCompanyLandLineNumber();
+               final DialableFaxNumber faxNumber = basicData.getCompanyFaxNumber();
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1}", landLineNumber, faxNumber)); //NOI18N
+
+               // Is a phone number instance set?
+               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for land-line number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       landLineNumber.setPhoneEntryCreated(new Date());
+
+                       // Set it back in basic data
+                       basicData.setCompanyLandLineNumber(landLineNumber);
+               }
+
+               // Is a fax number instance set?
+               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() == null)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug("setAllPhoneEntriesCreated: Setting created timestamp for fax number ..."); //NOI18N
+
+                       // Set updated timestamp
+                       faxNumber.setPhoneEntryCreated(new Date());
+
+                       // Set it back in basic data
+                       basicData.setCompanyFaxNumber(faxNumber);
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace("setAllPhoneEntriesCreated: EXIT!"); //NOI18N
+       }
+
+       /**
+        * Returns a detached instance from given mobile instance
+        * <p>
+        * @param mobileNumber  Mobile instance
+        * @param fetchedNumber Found mobile number in database
+        * <p>
+        * @return Detached instance
+        */
+       protected DialableMobileNumber getDetached (final DialableMobileNumber mobileNumber, final DialableMobileNumber fetchedNumber) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: mobileNumber={0},fetchedNumber={1} - CALLED!", mobileNumber, fetchedNumber)); //NOI18N
+
+               // Should be valid
+               if (null == mobileNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("mobileNumber is null"); //NOI18N
+               } else if (fetchedNumber.getPhoneId() == null) {
+                       // ..and again
+                       throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
+
+               // Init query instance
+               final DialableMobileNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
+
+               // Default is null
+               DialableMobileNumber detachedNumber = null;
+
+               // Is there a difference?
+               if (!PhoneUtils.isSameMobileNumber(mobileNumber, fetchedNumber)) {
+                       // Merge this entry
+                       detachedNumber = this.getEntityManager().merge(foundNumber);
+
+                       // @TODO Copy all
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
+
+               // Return it
+               return detachedNumber;
+       }
+
+       /**
+        * Returns a detached instance from given land-line instance
+        * <p>
+        * @param landLineNumber Land-line instance
+        * @param fetchedNumber  Found land-line number in database
+        * <p>
+        * @return Detached instance
+        */
+       protected DialableLandLineNumber getDetached (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: landLineNumber={0},fetchedNumber={1} - CALLED!", landLineNumber, fetchedNumber)); //NOI18N
+
+               // Should be valid
+               if (null == landLineNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("landLineNumber is null"); //NOI18N
+               } else if (fetchedNumber.getPhoneId() == null) {
+                       // ..and again
+                       throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
+
+               // Init query instance
+               final DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
+
+               // Default is null
+               DialableLandLineNumber detachedNumber = null;
+
+               // Is there a difference?
+               if (!PhoneUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
+                       // Merge this entry
+                       detachedNumber = this.getEntityManager().merge(foundNumber);
+
+                       // @TODO Copy all
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
+
+               // Return it
+               return detachedNumber;
+       }
+
+       /**
+        * Returns a detached instance from given fax instance
+        * <p>
+        * @param faxNumber     Fax instance
+        * @param fetchedNumber Found fax number in database
+        * <p>
+        * @return Detached instance
+        */
+       protected DialableFaxNumber getDetached (final DialableFaxNumber faxNumber, final DialableFaxNumber fetchedNumber) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: faxNumber={0},fetchedNumber={1} - CALLED!", faxNumber, fetchedNumber)); //NOI18N
+
+               // Should be valid
+               if (null == faxNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("faxNumber is null"); //NOI18N
+               } else if (fetchedNumber.getPhoneId() == null) {
+                       // ..and again
+                       throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
+
+               // Init query instance
+               final DialableFaxNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
+
+               // Default is null
+               DialableFaxNumber detachedNumber = null;
+
+               // Is there a difference?
+               if (!PhoneUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
+                       // Merge this entry
+                       detachedNumber = this.getEntityManager().merge(foundNumber);
+
+                       // @TODO Copy all
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
+
+               // Return it
+               return detachedNumber;
+       }
+
+       /**
+        * Returns a managed instance from given mobile number
+        * <p>
+        * @param mobileNumber  Mobile instance
+        * @param fetchedNumber Found mobile number in database
+        * <p>
+        * @return Managed instance
+        */
+       protected DialableMobileNumber getManaged (final DialableMobileNumber mobileNumber, final DialableMobileNumber fetchedNumber) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: mobileNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), mobileNumber, fetchedNumber)); //NOI18N
+
+               // Should be valid
+               if (null == mobileNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("mobileNumber is null"); //NOI18N
+               } else if (null == fetchedNumber) {
+                       // Throw NPE again
+                       throw new NullPointerException("fetchedNumber is null"); //NOI18N
+               } else if (fetchedNumber.getPhoneId() == null) {
+                       // ..and again
+                       throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
+
+               // Init query instance
+               final DialableMobileNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
+
+               // Default is null
+               DialableMobileNumber detachedNumber = null;
+
+               // Is there a difference?
+               if (!PhoneUtils.isSameMobileNumber(mobileNumber, fetchedNumber)) {
+                       // Merge this entry
+                       detachedNumber = this.getEntityManager().merge(foundNumber);
+
+                       // @TODO Copy all
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: detachedNumber={1} - EXIT!", this.getClass().getSimpleName(), detachedNumber)); //NOI18N
+
+               // Return it
+               return detachedNumber;
+       }
+
+       /**
+        * Returns a managed instance from given land-line number
+        * <p>
+        * @param landLineNumber Land-line instance
+        * @param fetchedNumber  Found land-line number in database
+        * <p>
+        * @return Managed instance
+        */
+       protected DialableLandLineNumber getManaged (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: landLineNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), landLineNumber, fetchedNumber)); //NOI18N
+
+               // Should be valid
+               if (null == landLineNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("landLineNumber is null"); //NOI18N
+               } else if (null == fetchedNumber) {
+                       // Throw NPE again
+                       throw new NullPointerException("fetchedNumber is null"); //NOI18N
+               } else if (fetchedNumber.getPhoneId() == null) {
+                       // ..and again
+                       throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
+
+               // Init query instance
+               final DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
+
+               // Default is null
+               DialableLandLineNumber detachedNumber = null;
+
+               // Is there a difference?
+               if (!PhoneUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
+                       // Merge this entry
+                       detachedNumber = this.getEntityManager().merge(foundNumber);
+
+                       // @TODO Copy all
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), detachedNumber)); //NOI18N
+
+               // Return it
+               return detachedNumber;
+       }
+
+       /**
+        * Returns a managed instance from given fax number
+        * <p>
+        * @param faxNumber     Fax instance
+        * @param fetchedNumber Found fax number in database
+        * <p>
+        * @return Managed instance
+        */
+       protected DialableFaxNumber getManaged (final DialableFaxNumber faxNumber, final DialableFaxNumber fetchedNumber) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: faxNumber={1},fetchedNumber={2} - CALLED!", this.getClass().getSimpleName(), faxNumber, fetchedNumber)); //NOI18N
+
+               // Should be valid
+               if (null == faxNumber) {
+                       // Throw NPE
+                       throw new NullPointerException("faxNumber is null"); //NOI18N
+               } else if (null == fetchedNumber) {
+                       // Throw NPE again
+                       throw new NullPointerException("fetchedNumber is null"); //NOI18N
+               } else if (fetchedNumber.getPhoneId() == null) {
+                       // ..and again
+                       throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
+
+               // Init query instance
+               final DialableFaxNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
+
+               // Default is null
+               DialableFaxNumber detachedNumber = null;
+
+               // Is there a difference?
+               if (!PhoneUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
+                       // Merge this entry
+                       detachedNumber = this.getEntityManager().merge(foundNumber);
+
+                       // @TODO Copy all
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getDetached: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), detachedNumber)); //NOI18N
+
+               // Return it
+               return detachedNumber;
+       }
+
+       /**
+        * Merges given contact's data
+        * <p>
+        * @param detachedContact Contact instance to merge
+        * <p>
+        * @return Detached contact instance
+        */
+       protected Contact mergeContactData (final Contact detachedContact) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactData: contact={1} - CALLED!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
+
+               // The contact instance must be valid
+               if (null == detachedContact) {
+                       // Throw NPE again
+                       throw new NullPointerException("detachedContact is null"); //NOI18N
+               } else if (detachedContact.getContactId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
+               } else if (detachedContact.getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalStateException(MessageFormat.format("{0}.detachedContact.contactId={1} is not valid.", this.getClass().getSimpleName(), detachedContact.getContactId())); //NOI18N
+               }
+
+               // Set updated timestamp
+               detachedContact.setContactUpdated(new Date());
+
+               // Get contact from it and find it
+               final Contact foundContact = this.getEntityManager().find(detachedContact.getClass(), detachedContact.getContactId());
+
+               // Should be found
+               assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", detachedContact.getContactId()); //NOI18N
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateUserPersonalData: foundContact.contactId={1}", this.getClass().getSimpleName(), foundContact.getContactId())); //NOI18N
+
+               // Is a fax number set?
+               if (detachedContact.getContactFaxNumber() instanceof DialableFaxNumber) {
+                       // Make fax numbers managed
+                       foundContact.setContactFaxNumber(this.getManaged(detachedContact.getContactFaxNumber(), detachedContact.getContactFaxNumber()));
+               }
+
+               // Is a land-line number set?
+               if (detachedContact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
+                       // Make land-line numbers managed
+                       foundContact.setContactLandLineNumber(this.getManaged(detachedContact.getContactLandLineNumber(), detachedContact.getContactLandLineNumber()));
+               }
+
+               // Is a mobile number set?
+               if (detachedContact.getContactMobileNumber() instanceof DialableMobileNumber) {
+                       // Make mobile numbers managed
+                       foundContact.setContactMobileNumber(this.getManaged(detachedContact.getContactMobileNumber(), detachedContact.getContactMobileNumber()));
+               }
+
+               // Merge contact instance
+               final Contact managedContact = this.getEntityManager().merge(foundContact);
+
+               // Copy all
+               Contacts.copyAll(detachedContact, managedContact);
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactData: foundContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
+
+               // Return detached contact
+               return managedContact;
+       }
+
+       /**
+        * Merges given (detached) contact's mobile, land-line and fax numbers
+        * <p>
+        * @param detachedContact Detached contact instance
+        */
+       protected void mergeContactsMobileLandLineFaxNumbers (final Contact detachedContact) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactsMobileLandLineFaxNumbers: detachedContact={1} - CALLED!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
+
+               // The contact instance must be valid
+               if (null == detachedContact) {
+                       // Throw NPE again
+                       throw new NullPointerException("detachedContact is null"); //NOI18N
+               } else if (detachedContact.getContactId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("detachedContact.contactId is null"); //NOI18N //NOI18N
+               } else if (detachedContact.getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalStateException(MessageFormat.format("{0}.detachedContact.contactId={1} is not valid.", this.getClass().getSimpleName(), detachedContact.getContactId())); //NOI18N
+               }
+
+               // Get all instances
+               final DialableMobileNumber mobile = detachedContact.getContactMobileNumber();
+               final DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber();
+               final DialableFaxNumber fax = detachedContact.getContactFaxNumber();
+
+               // Is there a  mobile instance set?
+               if (mobile instanceof DialableMobileNumber) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: mobile.phoneId={0} is being updated ...", mobile.getPhoneId())); //NOI18N
+
+                       // Then find it, too
+                       final DialableMobileNumber foundMobile = this.getEntityManager().find(mobile.getClass(), mobile.getPhoneId());
+
+                       // Should be there
+                       assert (foundMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", foundMobile.getPhoneId()); //NOI18N
+
+                       // Then merge it, too
+                       final DialableMobileNumber managedMobile = this.getEntityManager().merge(foundMobile);
+
+                       // Should be there
+                       assert (managedMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", managedMobile.getPhoneId()); //NOI18N
+
+                       // Copy all
+                       MobileNumbers.copyAll(detachedContact.getContactMobileNumber(), managedMobile);
+
+                       // Set it back
+                       detachedContact.setContactMobileNumber(managedMobile);
+               }
+
+               // Is there a  fax instance set?
+               if (fax instanceof DialableFaxNumber) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: fax.phoneId={0} is being updated ...", fax.getPhoneId())); //NOI18N
+
+                       // Then find it, too
+                       final DialableFaxNumber foundFax = this.getEntityManager().find(fax.getClass(), fax.getPhoneId());
+
+                       // Should be there
+                       assert (foundFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", foundFax.getPhoneId()); //NOI18N
+
+                       // Then merge it, too
+                       final DialableFaxNumber managedFax = this.getEntityManager().merge(foundFax);
+
+                       // Should be there
+                       assert (managedFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", managedFax.getPhoneId()); //NOI18N
+
+                       // Copy all
+                       FaxNumbers.copyAll(detachedContact.getContactFaxNumber(), managedFax);
+
+                       // Set it back
+                       detachedContact.setContactFaxNumber(managedFax);
+               }
+
+               // Is there a  fax instance set?
+               if (landLine instanceof DialableLandLineNumber) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: landLine.phoneId={0} is being updated ...", landLine.getPhoneId())); //NOI18N
+
+                       // Then find it, too
+                       final DialableLandLineNumber foundLandLine = this.getEntityManager().find(landLine.getClass(), landLine.getPhoneId());
+
+                       // Should be there
+                       assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); //NOI18N
+
+                       // Then merge it, too
+                       final DialableLandLineNumber managedLandLine = this.getEntityManager().merge(foundLandLine);
+
+                       // Should be there
+                       assert (managedLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", managedLandLine.getPhoneId()); //NOI18N
+
+                       // Copy all
+                       LandLineNumbers.copyAll(detachedContact.getContactLandLineNumber(), managedLandLine);
+
+                       // Set it back
+                       detachedContact.setContactLandLineNumber(managedLandLine);
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace("mergeContactsMobileLandLineFaxNumbers: EXIT!"); //NOI18N
+       }
+
+       /**
+        * Sends an email with given subject line, template name to given recipient
+        * and user data
+        * <p>
+        * @param subjectLine    Subject line
+        * @param templateName   Template name
+        * @param user           User instance
+        * @param baseUrl        Base URL
+        * @param randomPassword A randomly-generated password or NULL if user had
+        *                       to enter it.
+        */
+       protected void sendEmail (final String subjectLine, final String templateName, final User user, final String baseUrl, final String randomPassword) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmail: subjectLine={0},templateName={1},user={2},baseUrl={3} - CALLED!", subjectLine, templateName, user, baseUrl)); //NOI18N
+
+               // All should be set
+               if (null == subjectLine) {
+                       // Throw NPE
+                       throw new NullPointerException("subjectLine is null"); //NOI18N
+               } else if (subjectLine.isEmpty()) {
+                       // No subject line
+                       throw new IllegalArgumentException("subjectLine is empty"); //NOI18N
+               } else if (null == templateName) {
+                       // Throw NPE
+                       throw new NullPointerException("templateName is null"); //NOI18N
+               } else if (templateName.isEmpty()) {
+                       // No template name
+                       throw new IllegalArgumentException("templateName is empty"); //NOI18N
+               } else if (null == user) {
+                       // Throw NPE
+                       throw new NullPointerException("user is null"); //NOI18N
+               } else if (user.getUserId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userId is null"); //NOI18N
+               } else if (user.getUserId() < 1) {
+                       // Not valid number
+                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid.", user.getUserId())); //NOI18N
+               } else if (user.getUserName() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userName is null"); //NOI18N
+               } else if (user.getUserName().isEmpty()) {
+                       // Empty string
+                       throw new IllegalArgumentException("user.userName is empty"); //NOI18N
+               } else if (user.getUserAccountStatus() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
+               } else if (user.getUserContact() == null) {
+                       // Throw it again
+                       throw new NullPointerException("user.userContact is null"); //NOI18N
+               } else if (user.getUserContact().getContactId() == null) {
+                       // .. and again
+                       throw new NullPointerException("user.userContact.contactId is null"); //NOI18N
+               } else if (user.getUserContact().getContactId() < 1) {
+                       // Invalid id
+                       throw new IllegalArgumentException(MessageFormat.format("user.userContact.contactId={0} is invalid", user.getUserContact().getContactId())); //NOI18N
+               } else if (user.getUserContact().getContactPersonalTitle() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userContact.contactPersonalTitle is null"); //NOI18N
+               } else if (user.getUserLocale() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userLocale is null"); //NOI18N
+               } else if (this.getSession() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.session is not set. Have you forgotten to call super(String, String) and called only super() ?"); //NOI18N
+               }
+
+               // Set all values
+               final Properties variables = Users.getAllUserFields(user);
+
+               // Set base URL and random password
+               variables.put("baseUrl", baseUrl); //NOI18N
+               variables.put("randomPassword", ""); //NOI18N
+
+               // Is the random password set?
+               if ((randomPassword instanceof String) && (!randomPassword.isEmpty())) {
+                       variables.put("randomPassword", randomPassword); //NOI18N
+               }
+
+               // Init addresss
+               final Address recipientAddress;
+
+               try {
+                       // Create email address and set
+                       recipientAddress = new InternetAddress(user.getUserContact().getContactEmailAddress());
+               } catch (final AddressException ex) {
+                       // Throw again
+                       throw new EJBException(ex);
+               }
+
+               // Prepare mail wrapper
+               // @TODO Language from message bundle
+               final WrapableEmailDelivery emailWrapper = new EmailDeliveryWrapper(recipientAddress, subjectLine, templateName, variables, user.getUserLocale());
+
+               try {
+                       // Send out email change
+                       final ObjectMessage message = this.getSession().createObjectMessage();
+                       message.setObject(emailWrapper);
+
+                       // Send message
+                       this.sendMessage(message);
+               } catch (final JMSException ex) {
+                       // Throw again
+                       throw new EJBException(ex);
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace("sendEmail: EXIT!"); //NOI18N
+       }
+
+       /**
+        * Updates all contact's phone instances from other contact, both contacts
+        * should be the same.
+        * <p>
+        * @param contact Contact to set instances
+        * @param other   Other contact to get instances from
+        */
+       protected void setAllContactPhoneEntries (final Contact contact, final Contact other) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntries: contact={1},other={2} - CALLED!", this.getClass().getSimpleName(), contact, other)); //NOI18N
+
+               // Both must be the same and not null
+               if (null == contact) {
+                       // Throw NPE
+                       throw new NullPointerException("contact is null"); //NOI18N
+               } else if (null == other) {
+                       // Throw NPE
+                       throw new NullPointerException("other is null"); //NOI18N
+               } else if (!Objects.equals(contact, other)) {
+                       // Not same instances
+                       throw new IllegalArgumentException(MessageFormat.format("contact={0} and other={1} are not equal!", contact, other)); //NOI18N
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactMobileNumber={0}", other.getContactMobileNumber())); //NOI18N
+
+               // Is other mobile not set?
+               if ((other.getContactMobileNumber() == null) || (PhoneUtils.isSameMobileNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying mobile entry ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Is the fax number set?
+                       if (other.getContactMobileNumber() instanceof DialableMobileNumber) {
+                               // Copy mobile number
+                               contact.setContactMobileNumber(this.getManaged(other.getContactMobileNumber(), contact.getContactMobileNumber()));
+                       } else {
+                               // Null it
+                               contact.setContactMobileNumber(null);
+                       }
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactLandLineNumber={0}", other.getContactLandLineNumber())); //NOI18N
+
+               // Is other mobile not set?
+               if ((other.getContactLandLineNumber() == null) || (PhoneUtils.isSameLandLineNumber(contact.getContactLandLineNumber(), other.getContactLandLineNumber()))) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying land-line entry ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Is the land-line number set?
+                       if (other.getContactLandLineNumber() instanceof DialableLandLineNumber) {
+                               // Copy land-line number
+                               contact.setContactLandLineNumber(this.getManaged(other.getContactLandLineNumber(), contact.getContactLandLineNumber()));
+                       } else {
+                               // Null it
+                               contact.setContactLandLineNumber(null);
+                       }
+               }
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: other.contactFaxNumber={1}", this.getClass().getSimpleName(), other.getContactFaxNumber())); //NOI18N
+
+               // Is other mobile not set?
+               if ((other.getContactFaxNumber() == null) || (PhoneUtils.isSameFaxNumber(contact.getContactFaxNumber(), other.getContactFaxNumber()))) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntries: Copying fax entry ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Is the fax number set?
+                       if (other.getContactFaxNumber() instanceof DialableFaxNumber) {
+                               // Copy fax number
+                               contact.setContactFaxNumber(this.getManaged(other.getContactFaxNumber(), contact.getContactFaxNumber()));
+                       } else {
+                               // Null it
+                               contact.setContactFaxNumber(null);
+                       }
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntries: EXIT!", this.getClass().getSimpleName())); //NOI18N
+       }
+
+       /**
+        * Updates all contact's phone entry's updated timestamps
+        * <p>
+        * @param contact            Contact instance to update
+        * @param isMobileUnlinked   Whether a mobile entry has been unlinked in
+        *                           contact instance
+        * @param isLandlineUnlinked Whether a land-line entry has been unlinked in
+        *                           contact instance
+        * @param isFaxUnlinked      Whether a fax entry has been unlinked in
+        *                           contact instance
+        */
+       protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: contact={1},isMobileUnlinked={2},isLandlineUnlinked={3},isFaxUnlinked={4} - CALLED", this.getClass().getSimpleName(), contact, isMobileUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
+
+               // The contact instance must be valid
+               if (null == contact) {
+                       // Throw NPE again
+                       throw new NullPointerException("contact is null"); //NOI18N
+               } else if (contact.getContactId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
+               } else if (contact.getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
+               }
+
+               // Get all phone instances
+               final DialableLandLineNumber landLineNumber = contact.getContactLandLineNumber();
+               final DialableFaxNumber faxNumber = contact.getContactFaxNumber();
+               final DialableMobileNumber mobileNumber = contact.getContactMobileNumber();
+
+               // Flags and instances must be constistent
+               if (isMobileUnlinked && mobileNumber instanceof DialableMobileNumber) {
+                       // Bad state
+                       throw new IllegalStateException("isCellPhoneUnlinked is TRUE, but mobileNumber is set."); //NOI18N
+               } else if (isLandlineUnlinked && landLineNumber instanceof DialableLandLineNumber) {
+                       // Bad state
+                       throw new IllegalStateException("isLandlineUnlinked is TRUE, but landLineNumber is set."); //NOI18N
+               } else if (isFaxUnlinked && faxNumber instanceof DialableFaxNumber) {
+                       // Bad state
+                       throw new IllegalStateException("isFaxUnlinked is TRUE, but faxNumber is set."); //NOI18N
+               }
+
+               // Is a phone number instance set?
+               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneId() instanceof Long) && (landLineNumber.getPhoneId() > 0)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for land-line number ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Set updated timestamp
+                       landLineNumber.setPhoneEntryUpdated(new Date());
+               }
+
+               // Is a fax number instance set?
+               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneId() instanceof Long) && (faxNumber.getPhoneId() > 0)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for fax number ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Set updated timestamp
+                       faxNumber.setPhoneEntryUpdated(new Date());
+               }
+
+               // Is a mobile number instance set?
+               if ((mobileNumber instanceof DialableMobileNumber) && (mobileNumber.getPhoneId() instanceof Long) && (mobileNumber.getPhoneId() > 0)) {
+                       // Debug message
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for mobile number ...", this.getClass().getSimpleName())); //NOI18N
+
+                       // Set updated timestamp
+                       mobileNumber.setPhoneEntryUpdated(new Date());
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: EXIT!", this.getClass().getSimpleName())); //NOI18N
+       }
+
+}
index b5730d86658c3d60f8ca4397c6b9a528421035c3..31f97c3fe713faffb183edeb5836a0c250ae3e03 100644 (file)
@@ -28,7 +28,7 @@ import org.mxchange.jaddressbook.exceptions.AddressbookNotFoundException;
 import org.mxchange.jaddressbook.model.addressbook.Addressbook;
 import org.mxchange.jaddressbook.model.addressbook.UserAddressbook;
 import org.mxchange.jaddressbook.model.addressbook.entry.AddressbookEntry;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
index 20907b5c8f83bcdc5d0e6956f878774ac359b9f6..4919f861f0ea97bed79d1a38bc137a528a6c251b 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.jphone.model.phonenumbers.mobileprovider;
 import java.text.MessageFormat;
 import java.util.Date;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.exceptions.mobileprovider.MobileProviderAlreadyAddedException;
 
 /**
index 4684721e5a8e68ea5ab3d3ff18c7aeff14650616..08ae441fe989ee93240423e444fdf946e76e5350 100644 (file)
@@ -21,7 +21,7 @@ import java.util.List;
 import javax.ejb.Singleton;
 import javax.ejb.Startup;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 
 /**
  * A singleton EJB for mobile provider informations
index 5eb9c37650441538eee7c71a6e94485cf04d14e1..f935f619710d5bfa654a2cc0ef4d0faa2c92e04d 100644 (file)
@@ -19,9 +19,13 @@ package org.mxchange.jphone.model.phonenumbers.phone;
 import java.text.MessageFormat;
 import java.util.Date;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
+import org.mxchange.jfinancials.enterprise.BaseFinancialsEnterpriseBean;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
 
 /**
@@ -46,7 +50,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
        }
 
        @Override
-       public void deleteFaxData (final org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber faxNumber) {
+       public void deleteFaxData (final DialableFaxNumber faxNumber) {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteFaxData: faxNumber={1} - CALLED!", this.getClass().getSimpleName(), faxNumber));
 
@@ -84,7 +88,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
                }
 
                // Get a managed instance
-               final org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber managedNumber = this.getEntityManager().getReference(faxNumber.getClass(), faxNumber.getPhoneId());
+               final DialableFaxNumber managedNumber = this.getEntityManager().getReference(faxNumber.getClass(), faxNumber.getPhoneId());
 
                // Remove it from database
                this.getEntityManager().remove(managedNumber);
@@ -94,7 +98,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
        }
 
        @Override
-       public void deleteLandLineData (final org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber landLineNumber) {
+       public void deleteLandLineData (final DialableLandLineNumber landLineNumber) {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteLandLineData: landLineNumber={1} - CALLED!", this.getClass().getSimpleName(), landLineNumber));
 
@@ -132,7 +136,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
                }
 
                // Get a managed instance
-               final org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber managedNumber = this.getEntityManager().getReference(landLineNumber.getClass(), landLineNumber.getPhoneId());
+               final DialableLandLineNumber managedNumber = this.getEntityManager().getReference(landLineNumber.getClass(), landLineNumber.getPhoneId());
 
                // Remove it from database
                this.getEntityManager().remove(managedNumber);
@@ -142,7 +146,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
        }
 
        @Override
-       public void deleteMobileData (final org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber mobileNumber) {
+       public void deleteMobileData (final DialableMobileNumber mobileNumber) {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber));
 
@@ -174,7 +178,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
                }
 
                // Get a managed instance
-               final org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber managedNumber = this.getEntityManager().getReference(mobileNumber.getClass(), mobileNumber.getPhoneId());
+               final DialableMobileNumber managedNumber = this.getEntityManager().getReference(mobileNumber.getClass(), mobileNumber.getPhoneId());
 
                // Remove it from database
                this.getEntityManager().remove(managedNumber);
@@ -184,7 +188,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
        }
 
        @Override
-       public org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber updateFaxData (final org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber faxNumber) {
+       public DialableFaxNumber updateFaxData (final DialableFaxNumber faxNumber) {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateFaxData: faxNumber={1} - CALLED!", this.getClass().getSimpleName(), faxNumber));
 
@@ -222,10 +226,10 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
                }
 
                // Get contact from it and find it
-               final org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber managedNumber = this.getEntityManager().find(faxNumber.getClass(), faxNumber.getPhoneId());
+               final DialableFaxNumber managedNumber = this.getEntityManager().find(faxNumber.getClass(), faxNumber.getPhoneId());
 
                // Should be found
-               assert (managedNumber instanceof org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber) : MessageFormat.format("Cell phone number with id {0} not found, but should be.", faxNumber.getPhoneId()); //NOI18N
+               assert (managedNumber instanceof DialableFaxNumber) : MessageFormat.format("Cell phone number with id {0} not found, but should be.", faxNumber.getPhoneId()); //NOI18N
 
                // Debug message
                this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateFaxData: managedNumber.phoneId={1}", this.getClass().getSimpleName(), managedNumber.getPhoneId())); //NOI18N
@@ -242,7 +246,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
        }
 
        @Override
-       public org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber updateLandLineData (final org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber landLineNumber) {
+       public DialableLandLineNumber updateLandLineData (final DialableLandLineNumber landLineNumber) {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateLandLineData: landLineNumber={1} - CALLED!", this.getClass().getSimpleName(), landLineNumber));
 
@@ -280,10 +284,10 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
                }
 
                // Get contact from it and find it
-               final org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber managedNumber = this.getEntityManager().find(landLineNumber.getClass(), landLineNumber.getPhoneId());
+               final DialableLandLineNumber managedNumber = this.getEntityManager().find(landLineNumber.getClass(), landLineNumber.getPhoneId());
 
                // Should be found
-               assert (managedNumber instanceof org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber) : MessageFormat.format("Cell phone number with id {0} not found, but should be.", landLineNumber.getPhoneId()); //NOI18N
+               assert (managedNumber instanceof DialableLandLineNumber) : MessageFormat.format("Cell phone number with id {0} not found, but should be.", landLineNumber.getPhoneId()); //NOI18N
 
                // Debug message
                this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateLandLineData: managedNumber.phoneId={1}", this.getClass().getSimpleName(), managedNumber.getPhoneId())); //NOI18N
@@ -300,7 +304,7 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
        }
 
        @Override
-       public org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber updateMobileData (final org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber mobileNumber) {
+       public DialableMobileNumber updateMobileData (final DialableMobileNumber mobileNumber) {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber));
 
@@ -332,10 +336,10 @@ public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements
                }
 
                // Get contact from it and find it
-               final org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber managedNumber = this.getEntityManager().find(mobileNumber.getClass(), mobileNumber.getPhoneId());
+               final DialableMobileNumber managedNumber = this.getEntityManager().find(mobileNumber.getClass(), mobileNumber.getPhoneId());
 
                // Should be found
-               assert (managedNumber instanceof org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber) : MessageFormat.format("Cell phone number with id {0} not found, but should be.", mobileNumber.getPhoneId()); //NOI18N
+               assert (managedNumber instanceof DialableMobileNumber) : MessageFormat.format("Cell phone number with id {0} not found, but should be.", mobileNumber.getPhoneId()); //NOI18N
 
                // Debug message
                this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateMobileData: managedNumber.phoneId={1}", this.getClass().getSimpleName(), managedNumber.getPhoneId())); //NOI18N
index c6a29e44180244b5effbde71e651ba186a9ff7d3..49bff00db96a5f3887a5da9cdf9d5cd00b4a5ebf 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
index ae9c93a452315f669da9a13e8ce5b61152ad3209..8daa0dc73a9d260f128144124bea6208e54325d7 100644 (file)
@@ -21,7 +21,7 @@ import java.util.Date;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
index 4b060e4b68a41b36e3bfad20bba5ca4fa9151165..eb12a67c5482eab04e58c35b108040f166a48f16 100644 (file)
@@ -27,7 +27,7 @@ import javax.persistence.PersistenceException;
 import javax.persistence.Query;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontacts.model.contact.Contacts;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
index 1999b584cae464383a294baf0daa5ced8cbf4310..15dc9bc93d8fac952879ed2527d0c31d544ba389 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017, 2018 Free Software Foundation
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
  */
 package org.mxchange.jusercore.model.user.activity;
 
+import java.io.Serializable;
 import java.text.MessageFormat;
-import java.util.List;
-import javax.ejb.EJBException;
-import javax.ejb.Stateless;
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
 import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
 import javax.jms.ObjectMessage;
-import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jfinancials.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
- * A stateless, session-scoped EJB for user-activity
+ * A message-driven bean for adding user activity log
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Stateless (name = "userActivity", description = "A stateless, session-scored user-activity bean.")
-public class JobsUserActivityLogMessageBean extends BaseJobsEnterpriseBean implements UserActivityLogSessionBeanRemote {
+@MessageDriven (
+               name = "userActivityLog",
+               description = "A message-driven bean for adding user activity log",
+               activationConfig = {
+                       @ActivationConfigProperty (
+                                       propertyName = "destinationLookup",
+                                       propertyValue = "jms/jfinancials-user-activity-log"
+                       ),
+                       @ActivationConfigProperty (
+                                       propertyName = "destinationType",
+                                       propertyValue = "javax.jms.Queue"
+                       )
+               }
+)
+public class JobsUserActivityLogMessageBean extends BaseJobsEnterpriseBean implements MessageListener {
 
        /**
         * Serial number
         */
-       private static final long serialVersionUID = 1_268_376_401_659L;
+       private static final long serialVersionUID = 14_920_686_785_732_054L;
 
        /**
         * Default constructor
         */
        public JobsUserActivityLogMessageBean () {
-               // Invoke super constructor
-               super("jms/jjobs-queue-factory", "jms/jjobs-user-activity-log"); //NOI18N
+               // Call super constructor
+               super();
        }
 
        @Override
-       public void addUserActivityLog (final LogableUserActivity userActivity) {
+       public void onMessage (final Message message) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addUserActivityLog: userActivity={1} - CALLED!", this.getClass().getSimpleName(), userActivity)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.onMessage: message={1} - CALLED!", this.getClass().getSimpleName(), message)); //NOI18N
 
-               // Validate parameter
-               if (null == userActivity) {
-                       // Throw NPE
-                       throw new NullPointerException("userActivity is null"); //NOI18N
-               } else if (userActivity.getActivityContactFamilyName() == null) {
-                       // Throw it again
-                       throw new NullPointerException("userActivity.activityContactFamilyName is null"); //NOI18N
-               } else if (userActivity.getActivityContactFamilyName().isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("userActivity.activityContactFamilyName is empty"); //NOI18N
-               } else if (userActivity.getActivityContactFirstName() == null) {
-                       // Throw NPE
-                       throw new NullPointerException("userActivity.activityContactFirstName is null"); //NOI18N
-               } else if (userActivity.getActivityContactFirstName().isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("userActivity.activityContactFirstName is empty"); //NOI18N
-               } else if (userActivity.getActivityContactPersonalTitle() == null) {
+               // The parameter should be valid
+               if (null == message) {
                        // Throw NPE
-                       throw new NullPointerException("userActivity.activityContactPersonalTitle is null"); //NOI18N
-               } else if ((userActivity.getActivityMessage() != null) && (userActivity.getActivityMessage().isEmpty())) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("userActivity.activityMessage is empty"); //NOI18N
-               } else if (userActivity.getActivityType() == null) {
-                       // Throw NPE
-                       throw new NullPointerException("userActivity.activityType is null"); //NOI18N
-               } else if (userActivity.getActivityType().isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("userActivity.activityType is empty"); //NOI18N
-               } else if (userActivity.getActivityUserName() == null) {
-                       // Throw NPE
-                       throw new NullPointerException("userActivity.activityUserName is null"); //NOI18N
-               } else if (userActivity.getActivityUserName().isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("userActivity.activityUserName is empty"); //NOI18N
-               } else if (userActivity.getActivityId() != null) {
-                       // Throw it again
-                       throw new IllegalArgumentException("userActivity.activityId should never be set."); //NOI18N
+                       throw new NullPointerException("message is null"); //NOI18N
+               } else if (!(message instanceof ObjectMessage)) {
+                       // Not implementing right interface
+                       throw new IllegalArgumentException(MessageFormat.format("message={0} does not implemented ObjectMessage", message)); //NOI18N
                }
 
-               try {
-                       // Send out email change
-                       final ObjectMessage message = this.getSession().createObjectMessage();
-                       message.setObject(userActivity);
+               // Securely cast it
+               final ObjectMessage objectMessage = (ObjectMessage) message;
 
-                       // Send message
-                       this.sendMessage(message);
+               // Init variable
+               final Serializable serializable;
+
+               try {
+                       // Get object from message
+                       serializable = objectMessage.getObject();
                } catch (final JMSException ex) {
-                       // Throw again
-                       throw new EJBException(ex);
+                       // Log it and don't continue any further
+                       this.getLoggerBeanLocal().logException(ex);
+                       return;
                }
 
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addUserActivityLog: EXIT!", this.getClass().getSimpleName())); //NOI18N
-       }
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.onMessage: serializable={1}", this.getClass().getSimpleName(), serializable)); //NOI18N
 
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<LogableUserActivity> fetchAllUserActivityLog () {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUserActivityLog: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Get named query
-               final Query query = this.getEntityManager().createNamedQuery("AllUserActivityLog"); //NOI18N
-
-               // Get list from it
-               List<LogableUserActivity> list = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUserActivityLog: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+               // Okay, is it the right interface?
+               if (null == serializable) {
+                       // Throw NPE
+                       throw new NullPointerException("serializable is null"); //NOI18N
+               } else if (!(serializable instanceof LogableUserActivity)) {
+                       // Not correct object send
+                       throw new IllegalArgumentException(MessageFormat.format("serializable={0} does not implement LogableUserActivity", serializable)); //NOI18N
+               }
 
-               // Return it
-               return list;
-       }
+               // Securely cast it
+               final LogableUserActivity userActivity = (LogableUserActivity) serializable;
 
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<LogableUserActivity> fetchAllUsersActivityLog (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUsersActivityLog: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Validate parameters
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Id is set
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Not valid id number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
+               // Should be valid
+               if (null == userActivity) {
+                       // Throw NPE
+                       throw new NullPointerException("userActivity is null"); //NOI18N
+               } else if (userActivity.getActivityId() instanceof Long) {
+                       // Id number should not be set
+                       throw new IllegalArgumentException(MessageFormat.format("userActivity.activityId={0} should be null", userActivity.getActivityId())); //NOI18N
+               } else if (userActivity.getActivityUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("userActivity.activityUser is null"); //NOI18N
+               } else if (userActivity.getActivityUser().getUserId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("userActivity.activityUser.userId is null"); //NOI18N
+               } else if (userActivity.getActivityUser().getUserId() < 1) {
+                       // Throw NPE again
+                       throw new IllegalArgumentException(MessageFormat.format("userActivity.activityUser.userId={0}  is not valid", userActivity.getActivityUser().getUserId())); //NOI18N
+               } else if (userActivity.getActivityType() == null) {
+                       // Throw again ...
+                       throw new NullPointerException("userActivity.activityType is null"); //NOI18N
+               } else if (userActivity.getActivityType().isEmpty()) {
+                       // Empty type
+                       throw new IllegalArgumentException("userActivity.activityType is empty"); //NOI18N
+               } else if ((userActivity.getActivityMessage() instanceof String) && (userActivity.getActivityMessage().isEmpty())) {
+                       // Set but empty message
+                       throw new IllegalArgumentException("userActivity.activityMessage is empty"); //NOI18N
+               } else if (userActivity.getActivityTimestamp() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("userActivity.activityTimestamp is null"); //NOI18N
                }
 
-               // Get named query
-               final Query query = this.getEntityManager().createNamedQuery("SearchAllUsersActivity"); //NOI18N
+               // Make user instance managed
+               final User managedUser = this.createManaged(userActivity.getActivityUser());
 
-               // Set parameter
-               query.setParameter("activityUser", user); //NOI18N
+               // Set it back
+               userActivity.setActivityUser(managedUser);
 
-               // Get list from it
-               List<LogableUserActivity> list = query.getResultList();
+               // All fine, persist it
+               this.getEntityManager().persist(userActivity);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUsersActivityLog: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
-
-               // Return it
-               return list;
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.onMessage: EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
 }
index 0de00096b7172319681fa4d8f4ef0080a60c9a77..26e66fe1458ebc0c58928fab014f9dfde9342ff9 100644 (file)
@@ -24,7 +24,7 @@ import javax.ejb.EJBException;
 import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
 import org.mxchange.jusercore.model.email_address.EmailAddressChange;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
index 728e68db0a1398770e85d4b885b8923c8354e94f..0a5a9930c02f05f387dcb68557e49a4d2c552dd5 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
index 1b3f6209b1940323b33c45664f947af4d46b343f..51879cbeac6d9cc36df454b2c8e72d851c25053d 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.juserlogincore.model.user.login;
 import java.text.MessageFormat;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
index 069e17aa2934e1a0e4abdb5e7c4f095d3e6f0356..9065f008e019f5bd5c952164c88e64938186b8b0 100644 (file)
@@ -23,7 +23,7 @@ import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.model.user.AdminUserSessionBeanRemote;
index 03315962c949c29da5d6de85cc13115fecebeb8a..e28762f337484a1df24e5c552e816285251e2a81 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.Locale;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;