]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Please cherry-pick/rename:
authorRoland Häder <roland@mxchange.org>
Tue, 13 Mar 2018 22:05:44 +0000 (23:05 +0100)
committerRoland Häder <roland@mxchange.org>
Tue, 13 Mar 2018 22:14:57 +0000 (23:14 +0100)
- Headquarter is enough for bean name (please rename)
- removed some no longer recommended business methods
- removed no longer used private methods
- made some local variables final which helps the Java compiler in optimization
  of resulting byte-code
- added session EJB for user activity
- other improvements (?)
- changed copyright to Free Software Foundation

Signed-off-by: Roland Häder <roland@mxchange.org>
37 files changed:
src/java/log4j2.xml
src/java/org/mxchange/jcontacts/model/contact/FinancialsAdminContactSessionBean.java
src/java/org/mxchange/jcontacts/model/contact/FinancialsContactSessionBean.java
src/java/org/mxchange/jcontacts/model/phone/FinancialsAdminContactPhoneSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/basicdata/FinancialsAdminBusinessDataSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/basicdata/FinancialsBusinessDataSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/branchoffice/FinancialsAdminBranchOfficeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/branchoffice/FinancialsBranchOfficeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/department/FinancialsAdminDepartmentSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/department/FinancialsDepartmentSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/employee/FinancialsAdminEmployeeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/employee/FinancialsEmployeeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/headquarter/FinancialsAdminHeadquarterSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jcontactsbusiness/model/headquarter/FinancialsHeadquarterSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jcontactsbusiness/model/headquarters/FinancialsAdminHeadquartersSessionBean.java [deleted file]
src/java/org/mxchange/jcontactsbusiness/model/headquarters/FinancialsHeadquartersSessionBean.java [deleted file]
src/java/org/mxchange/jcontactsbusiness/model/opening_time/FinancialsAdminOpeningTimesSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/opening_time/FinancialsOpeningTimesSessionBean.java
src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java
src/java/org/mxchange/jcountry/model/data/FinancialsCountrySingletonBean.java
src/java/org/mxchange/jphone/model/phonenumbers/mobileprovider/FinancialsAdminMobileProviderSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/mobileprovider/FinancialsMobileProviderSingletonBean.java
src/java/org/mxchange/jphone/model/phonenumbers/phone/FinancialsAdminPhoneSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/phone/FinancialsPhoneSessionBean.java
src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java
src/java/org/mxchange/jproduct/model/category/FinancialsProductCategorySessionBean.java
src/java/org/mxchange/jproduct/model/product/FinancialsAdminGenericProductSessionBean.java
src/java/org/mxchange/jproduct/model/product/FinancialsGenericProductSessionBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/activity/FinancialsUserActivityLogMessageBean.java
src/java/org/mxchange/jusercore/model/user/activity/FinancialsUserActivitySessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jusercore/model/user/email_address/FinancialsUserEmailChangeSessionBean.java
src/java/org/mxchange/jusercore/model/user/password_history/FinancialsUserPasswordHistorySessionBean.java
src/java/org/mxchange/juserlogincore/model/user/login/FinancialsUserLoginSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/FinancialsUserRegistrationSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/resendlink/FinancialsResendLinkSessionBean.java

index 98e9a65f642174f1e53f38823251423cf6e9f0d3..90439ed601d6c2526267e601e8531774159f6c0b 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Copyright (C) 2016, 2017 Roland Häder
+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
index b33ae3a5cbcd6ceb198ae4a41766b305f6aa28de..f55e6744220c59ec64ef0c03deb734b79803b6c6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index 5828cb4b846664313294ea78a471e0dd72d448fc..a2db3210a5e712aab94d51d2d80fcf1a868b2eec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
@@ -66,62 +66,6 @@ public class FinancialsContactSessionBean extends BaseFinancialsDatabaseBean imp
                return contacts;
        }
 
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<String> allEmailAddresses () {
-               // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getEmailAddressList - CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Create query instance
-               final Query query = this.getEntityManager().createNamedQuery("AllContactEmailAddresses"); //NOI18N
-
-               // Get list
-               final List<String> emailAddresses = query.getResultList();
-
-               // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getEmailAddressList: emailAddresses.size()={1} - EXIT!", this.getClass().getSimpleName(), emailAddresses.size())); //NOI18N
-
-               // Return it
-               return emailAddresses;
-       }
-
-       @Override
-       public boolean isEmailAddressRegistered (final String emailAddress) {
-               // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: emailAddress={1} - CALLED!", this.getClass().getSimpleName(), emailAddress)); //NOI18N
-
-               // The email address should be valid
-               if (null == emailAddress) {
-                       // Is null
-                       throw new NullPointerException("emailAddress is null"); //NOI18N
-               } else if (emailAddress.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
-               }
-
-               // Default is not found
-               boolean isFound = false;
-
-               try {
-                       // Ask other method for contact instance
-                       final Contact contact = this.findContactByEmailAddress(emailAddress);
-
-                       // Log debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.isEmailAddressRegistered: Found contact={1} for emailAddress={2}", this.getClass().getSimpleName(), contact, emailAddress)); //NOI18N
-
-                       // It is found ...
-                       isFound = true;
-               } catch (final ContactNotFoundException ex) {
-                       // @TODO Was not found, log exception for spam check?
-               }
-
-               // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: isFound={1} - EXIT!", this.getClass().getSimpleName(), isFound)); //NOI18N
-
-               // Return status
-               return isFound;
-       }
-
        @Override
        public Contact lookupContact (final Contact contact) {
                // Log trace message
@@ -160,7 +104,7 @@ public class FinancialsContactSessionBean extends BaseFinancialsDatabaseBean imp
                // Loop through all
                while (iterator.hasNext()) {
                        // Get contact
-                       Contact next = iterator.next();
+                       final Contact next = iterator.next();
 
                        // Is same contact?
                        if ((Objects.equals(contact, next)) || (ContactUtils.isSameContact(contact, next))) {
@@ -201,7 +145,7 @@ public class FinancialsContactSessionBean extends BaseFinancialsDatabaseBean imp
                this.setAllContactPhoneEntriesUpdated(contact, isCellphoneUnlinked, isLandlineUnlinked, isFaxUnlinked);
 
                // Merge mobile, land-line and fix
-               Contact detachedContact = this.mergeContactData(contact);
+               final Contact detachedContact = this.mergeContactData(contact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: detachedContact={1} - EXIT!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
@@ -228,12 +172,12 @@ public class FinancialsContactSessionBean extends BaseFinancialsDatabaseBean imp
                }
 
                // Is cell phone/land-line/fax number unlinked?
-               boolean isCellphoneUnlinked = (contact.getContactMobileNumber() == null);
-               boolean isLandLineUnlinked = (contact.getContactLandLineNumber() == null);
-               boolean isFaxUnlinked = (contact.getContactFaxNumber() == null);
+               final boolean isCellphoneUnlinked = (contact.getContactMobileNumber() == null);
+               final boolean isLandLineUnlinked = (contact.getContactLandLineNumber() == null);
+               final boolean isFaxUnlinked = (contact.getContactFaxNumber() == null);
 
                // Call other Method
-               Contact detachedContact = this.updateContactData(contact, isCellphoneUnlinked, isLandLineUnlinked, isFaxUnlinked);
+               final Contact detachedContact = this.updateContactData(contact, isCellphoneUnlinked, isLandLineUnlinked, isFaxUnlinked);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: detachedContact={1} - EXIT!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
@@ -242,57 +186,6 @@ public class FinancialsContactSessionBean extends BaseFinancialsDatabaseBean imp
                return detachedContact;
        }
 
-       /**
-        * Returns a contact instance which has the given email address.
-        * <p>
-        * @param emailAddress Email address
-        * <p>
-        * @return Contact instance
-        * <p>
-        * @throws ContactNotFoundException If the contact was not found
-        */
-       private Contact findContactByEmailAddress (final String emailAddress) throws ContactNotFoundException {
-               // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactByEmailAddress: emailAddress={1} - CALLED!", this.getClass().getSimpleName(), emailAddress)); //NOI18N
-
-               // The parameter must be valid
-               if (null == emailAddress) {
-                       // Throw NPE
-                       throw new NullPointerException("emailAddress is null"); //NOI18N
-               } else if (emailAddress.isEmpty()) {
-                       // Not valid
-                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
-               }
-
-               // Get query instance
-               final Query query = this.getEntityManager().createNamedQuery("SearchContactByEmailAddress", UserContact.class); //NOI18N
-
-               // Set parameter and limit
-               query.setParameter("emailAddress", emailAddress); //NOI18N
-               query.setMaxResults(1);
-
-               // Init contact instance
-               final Contact contact;
-
-               // Try to find a result
-               try {
-                       // Find a single result
-                       contact = (Contact) query.getSingleResult();
-
-                       // Log trace message
-                       this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactByEmailAddress: Found contact={1}", this.getClass().getSimpleName(), contact)); //NOI18N
-               } catch (final NoResultException ex) {
-                       // No result found
-                       throw new ContactNotFoundException(emailAddress, ex);
-               }
-
-               // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactByEmailAddress: contact={1} - EXIT!", this.getClass().getSimpleName(), contact)); //NOI18N
-
-               // Return found instance
-               return contact;
-       }
-
        /**
         * Returns a contact instance which has the given id number.
         * <p>
index 417e3b8be50d5a19abd734570757af0aca2259b9..cf7f6adea928fd443b711585a7250e1e92d10e43 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index 156489579b04cafc05f87d0f5adc90ce5dda3855..73949f62b75905ab69573003c7d0f8e5cdbe7eb7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
@@ -23,9 +23,10 @@ import java.util.Objects;
 import javax.ejb.EJB;
 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.jfinancials.database.BaseFinancialsDatabaseBean;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
 
 /**
  * An administrative stateless session bean for business data
@@ -101,6 +102,15 @@ public class FinancialsAdminBusinessDataSessionBean extends BaseFinancialsDataba
                        basicData.setCompanyContactEmployee(managedEmployee);
                }
 
+               // Is a headquarter set?
+               if (basicData.getCompanyHeadquarterData()instanceof Headquarter) {
+                       // Get managed instance
+                       final Headquarter managedHeadquarter = this.createManaged(basicData.getCompanyHeadquarterData());
+
+                       // Set it back
+                       basicData.setCompanyHeadquarterData(managedHeadquarter);
+               }
+
                // Set created timestamps for any assigned numbers
                this.setAllPhoneEntriesCreated(basicData);
 
index 508676533564521008f684cbd8871609e6755ef2..d3679c825a62ceddfb5543fab199adf3516fc215 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
index 85a2a2c75d1c1cd3ed9a2e6eba645943df32b556..f456d6309ed6e1cc194e9b15b5e68df0550b953d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
@@ -22,11 +22,11 @@ import java.util.List;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeAlreadyAddedException;
+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.jfinancials.database.BaseFinancialsDatabaseBean;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * A stateless session bean for administrative branch office purposes
index fe6647beb710896874509bb4a474a42d56f2fd42..e148e76847568c131f15b1265e9be3b22f07f233 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
index 7e0e1027c7ae462f4c550757f7e67a52bad81376..99dee24be84f9a6ea6291dd39f6ddc531aab7802 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
@@ -22,12 +22,12 @@ import java.util.List;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException;
+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.jfinancials.database.BaseFinancialsDatabaseBean;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcontactsbusiness.model.headquarters.Headquarter;
 
 /**
  * A stateless session bean for administrative department purposes
@@ -106,13 +106,13 @@ public class FinancialsAdminDepartmentSessionBean extends BaseFinancialsDatabase
                        department.setDepartmentBranchOffice(managedBranchOffice);
                }
 
-               // Is headquarters set?
-               if (department.getDepartmentHeadquarters() instanceof Headquarter) {
-                       // Get managed headquarters
-                       final Headquarter managedHeadquarters = this.createManaged(department.getDepartmentHeadquarters());
+               // Is headquarter set?
+               if (department.getDepartmentHeadquarter() instanceof Headquarter) {
+                       // Get managed headquarter
+                       final Headquarter managedHeadquarter = this.createManaged(department.getDepartmentHeadquarter());
 
                        // Set it back
-                       department.setDepartmentHeadquarters(managedHeadquarters);
+                       department.setDepartmentHeadquarter(managedHeadquarter);
                }
 
                // Is lead employee set?
index b95760e0409861c3c64f03d3d1050080e194b06d..051b36aba1e3a157860995b18dae94e376a1c107 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
index ecfb22a7c3f3f9a4ad2452c6e550959418c0ebd2..ef164210bb580b6d85d6ef6ab9d97c3d0678bffd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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.jcontactsbusiness.model.employee;
 
+import java.text.MessageFormat;
+import java.util.Date;
+import javax.ejb.EJB;
 import javax.ejb.Stateless;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontactsbusiness.exceptions.employee.EmployeeAlreadyAddedException;
+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.JobPosition;
 import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jusercore.model.user.User;
 
 /**
  * A stateless bean for administrative purposes for company employees.
@@ -32,6 +44,12 @@ public class FinancialsAdminEmployeeSessionBean extends BaseFinancialsDatabaseBe
         */
        private static final long serialVersionUID = 26_458_796_703_761L;
 
+       /**
+        * EJB for general company employee purposes
+        */
+       @EJB (lookup = "java:global/jfinancials-ejb/employee!org.mxchange.jcontactsbusiness.model.employee.EmployeeSessionBeanRemote")
+       private EmployeeSessionBeanRemote employeeBean;
+
        /**
         * Default constructor
         */
@@ -39,4 +57,191 @@ public class FinancialsAdminEmployeeSessionBean extends BaseFinancialsDatabaseBe
                super();
        }
 
+       @Override
+       public Employable addEmployee (final Employable employee) throws EmployeeAlreadyAddedException {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addEmployee(): employee={1} - CALLED!", this.getClass().getSimpleName(), employee)); //NOI18N
+
+               // Validate parameter
+               if (null == employee) {
+                       // Throw NPE
+                       throw new NullPointerException("employee is null"); //NOI18N
+               } else if (employee.getEmployeeId() != null) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeId={0} is unexpected.", employee.getEmployeeId())); //NOI18N
+               } else if (employee.getEmployeeCompany() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("employee.employeeCompany is null"); //NOI18N
+               } else if (employee.getEmployeeCompany().getBasicDataId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("employee.employeeCompany.basicDataId is null"); //NOI18N
+               } else if (employee.getEmployeeCompany().getBasicDataId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeCompany.basicDataId={0} is invalid.", employee.getEmployeeCompany().getBasicDataId())); //NOI18N
+               } else if (employee.getEmployeeBranchOffice() == null && employee.getEmployeeDepartment() == null && employee.getEmployeeHeadquarter() == null) {
+                       // At least one must be set
+                       throw new NullPointerException("employee.employeeBranchOffice, employee.employeeDepartment and employee.employeeHeadquarter is null"); //NOI18N
+               } else if (employee.getEmployeeBranchOffice() != null && employee.getEmployeeBranchOffice().getBranchId() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("employee.employeeBranchOffice.branchId is null"); //NOI18N
+               } else if (employee.getEmployeeBranchOffice() != null && employee.getEmployeeBranchOffice().getBranchId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeBranchOffice.branchId={0} is invalid.", employee.getEmployeeBranchOffice().getBranchId())); //NOI18N
+               } else if (employee.getEmployeeDepartment() != null && employee.getEmployeeDepartment().getDepartmentId() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("employee.employeeDepartment.departmentId is null"); //NOI18N
+               } else if (employee.getEmployeeDepartment() != null && employee.getEmployeeDepartment().getDepartmentId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeDepartment.departmentId={0} is invalid.", employee.getEmployeeDepartment().getDepartmentId())); //NOI18N
+               } else if (employee.getEmployeeHeadquarter() != null && employee.getEmployeeHeadquarter().getHeadquarterId() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("employee.employeeHeadquarter.headquarterId is null"); //NOI18N
+               } else if (employee.getEmployeeHeadquarter() != null && employee.getEmployeeHeadquarter().getHeadquarterId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeHeadquarter.headquarterId={0} is invalid.", employee.getEmployeeHeadquarter().getHeadquarterId())); //NOI18N
+               } else if ((employee.getEmployeePersonalData() == null) && (employee.getEmployeeNumber() == null)) {
+                       // Both are null
+                       throw new NullPointerException("employee.employeePersonalData and employee.employeeNumber are null"); //NOI18N
+               } else if ((employee.getEmployeePersonalData() != null) && (employee.getEmployeePersonalData().getContactId() == null)) {
+                       // Throw NPE
+                       throw new NullPointerException("employee.employeePersonalData.contactId is null"); //NOI18N
+               } else if ((employee.getEmployeePersonalData() != null) && (employee.getEmployeePersonalData().getContactId() < 1)) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeePersonalData.contactId={0} is invalid.", employee.getEmployeePersonalData().getContactId())); //NOI18N
+               } else if ((employee.getEmployeeNumber() != null) && (employee.getEmployeeNumber().isEmpty())) {
+                       // Throw it again
+                       throw new IllegalArgumentException("employee.employeeNumber is empty"); //NOI18N
+               } else if ((employee.getEmployeeMobileNumber() != null) && (employee.getEmployeeMobileNumber().getPhoneId() != null)) {
+                       // Throw once more
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeMobileNumber.phoneId={0} is unexpected.", employee.getEmployeeMobileNumber().getPhoneId())); //NOI18N
+               } else if ((employee.getEmployeePersonalData() != null) && (employee.getEmployeePersonalData().getContactId() == null)) {
+                       // Throw NPE
+                       throw new NullPointerException("employee.employeePersonalData.contactId is null"); //NOI18N
+               } else if ((employee.getEmployeePersonalData() != null) && (employee.getEmployeePersonalData().getContactId() < 1)) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeePersonalData.contactId={0} is unexpected.", employee.getEmployeePersonalData().getContactId())); //NOI18N
+               } else if ((employee.getEmployeePosition() != null) && (employee.getEmployeePosition().getJobPositionId() == null)) {
+                       // Throw NPE
+                       throw new NullPointerException("employee.employeePosition.jobPositionId is null"); //NOI18N
+               } else if ((employee.getEmployeePosition() != null) && (employee.getEmployeePosition().getJobPositionId() < 1)) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeePosition.jobPositionId={0} is unexpected.", employee.getEmployeePosition().getJobPositionId())); //NOI18N
+               } else if ((employee.getEmployeeUserOwner() != null) && (employee.getEmployeeUserOwner().getUserId() == null)) {
+                       // Throw NPE
+                       throw new NullPointerException("employee.employeeUserOwner.userId is null"); //NOI18N
+               } else if ((employee.getEmployeeUserOwner() != null) && (employee.getEmployeeUserOwner().getUserId() < 1)) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("employee.employeeUserOwner.userId={0} is unexpected.", employee.getEmployeeUserOwner().getUserId())); //NOI18N
+               } else if (this.isEmployeeAdded(employee)) {
+                       // Throw exception
+                       throw new EmployeeAlreadyAddedException();
+               }
+
+               // Make company (basic data) managed
+               employee.setEmployeeCompany(this.createManaged(employee.getEmployeeCompany()));
+
+               // Is branch office set?
+               if (employee.getEmployeeBranchOffice() instanceof BranchOffice) {
+                       // Then make it managed
+                       final BranchOffice branchOffice = this.createManaged(employee.getEmployeeBranchOffice());
+
+                       // Set it back
+                       employee.setEmployeeBranchOffice(branchOffice);
+               }
+
+               // Is department set?
+               if (employee.getEmployeeDepartment() instanceof Department) {
+                       // Then make it managed
+                       final Department department = this.createManaged(employee.getEmployeeDepartment());
+
+                       // Set it back
+                       employee.setEmployeeDepartment(department);
+               }
+
+               // Is headquarter set?
+               if (employee.getEmployeeHeadquarter() instanceof Headquarter) {
+                       // Then make it managed
+                       final Headquarter headquarter = this.createManaged(employee.getEmployeeHeadquarter());
+
+                       // Set it back
+                       employee.setEmployeeHeadquarter(headquarter);
+               }
+
+               // Is personal data set?
+               if (employee.getEmployeePersonalData() instanceof Contact) {
+                       // Then make it managed
+                       final Contact contact = this.createManaged(employee.getEmployeePersonalData());
+
+                       // Set it back
+                       employee.setEmployeePersonalData(contact);
+               }
+
+               // Is headquarter set?
+               if (employee.getEmployeePosition() instanceof JobPosition) {
+                       // Then make it managed
+                       final JobPosition jobPosition = this.createManaged(employee.getEmployeePosition());
+
+                       // Set it back
+                       employee.setEmployeePosition(jobPosition);
+               }
+
+               // Is headquarter set?
+               if (employee.getEmployeeUserOwner() instanceof User) {
+                       // Then make it managed
+                       final User user = this.createManaged(employee.getEmployeeUserOwner());
+
+                       // Set it back
+                       employee.setEmployeeUserOwner(user);
+               }
+
+               // Is mobile number set?
+               if (employee.getEmployeeMobileNumber() instanceof DialableMobileNumber) {
+                       // Yes, then set created there as well
+                       employee.getEmployeeMobileNumber().setPhoneEntryCreated(new Date());
+
+                       // Make mobile provider managed
+                       final MobileProvider mobileProvider = this.createManaged(employee.getEmployeeMobileNumber().getMobileProvider());
+
+                       // Set it back
+                       employee.getEmployeeMobileNumber().setMobileProvider(mobileProvider);
+               }
+
+               // Set created timestamp
+               employee.setEmployeeCreated(new Date());
+
+               // Persist it
+               this.getEntityManager().persist(employee);
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addEmployee(): employee.employeeId={1} - EXIT!", this.getClass().getSimpleName(), employee.getEmployeeId())); //NOI18N
+
+               // Return it
+               return employee;
+       }
+
+       /**
+        * Checks whether employee is already added
+        * <p>
+        * @param employee Employee to be checked
+        * <p>
+        * @return Whether employee is already added
+        */
+       private boolean isEmployeeAdded (final Employable employee) {
+               // Default is not added
+               boolean isFound = false;
+
+               // Check all entries
+               for (final Employable otherEmployee : this.employeeBean.allEmployees()) {
+                       // Is same found?
+                       if (Employees.isSameEmployeeFound(employee, otherEmployee)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
 }
index c2135eeca4480230f6a81c87cbb15eb753295f8c..b7a1aba90606048753dce38c1f0f41a09670ed6c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
@@ -33,7 +33,7 @@ public class FinancialsEmployeeSessionBean extends BaseFinancialsDatabaseBean im
        /**
         * Serial number
         */
-       private static final long serialVersionUID = 26_458_796_703_761L;
+       private static final long serialVersionUID = 26_458_796_703_762L;
 
        /**
         * Default constructor
diff --git a/src/java/org/mxchange/jcontactsbusiness/model/headquarter/FinancialsAdminHeadquarterSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/headquarter/FinancialsAdminHeadquarterSessionBean.java
new file mode 100644 (file)
index 0000000..fa93b1d
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2017, 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
+ * 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontactsbusiness.model.headquarter;
+
+import java.text.MessageFormat;
+import java.util.Date;
+import java.util.List;
+import javax.ejb.EJB;
+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.jfinancials.database.BaseFinancialsDatabaseBean;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A stateless session bean for administrative branch office purposes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "adminHeadquarter", description = "An administrative statless bean for handling branch office data (all)")
+public class FinancialsAdminHeadquarterSessionBean extends BaseFinancialsDatabaseBean implements AdminHeadquarterSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 58_467_386_571_701L;
+
+       /**
+        * General branch office bean
+        */
+       @EJB (lookup = "java:global/jfinancials-ejb/headquarter!org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote")
+       private HeadquarterSessionBeanRemote headquarterBean;
+
+       /**
+        * Default constructor
+        */
+       public FinancialsAdminHeadquarterSessionBean () {
+               // Call super constructor
+               super();
+       }
+
+       @Override
+       public Headquarter addHeadquarter (final Headquarter headquarter) throws HeadquarterAlreadyAddedException {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
+
+               // Validate parameter
+               if (null == headquarter) {
+                       // Throw NPE
+                       throw new NullPointerException("headquarter is null"); //NOI18N
+               } else if (headquarter.getHeadquarterId() instanceof Long) {
+                       // Should not happen
+                       throw new IllegalArgumentException("headquarter.branchId should not be set."); //NOI18N
+               } else if (this.isHeadquarterFound(headquarter)) {
+                       // Already added, abort here
+                       throw new HeadquarterAlreadyAddedException(headquarter);
+               }
+
+               // Add created timestamp
+               headquarter.setHeadquarterCreated(new Date());
+
+               // Is user instance set?
+               if (headquarter.getHeadquarterUserOwner() instanceof User) {
+                       // Get managed instance back
+                       final User managedUser = this.createManaged(headquarter.getHeadquarterUserOwner());
+
+                       // Set it back in branch office
+                       headquarter.setHeadquarterUserOwner(managedUser);
+               }
+
+               // Is user instance set?
+               if (headquarter.getHeadquarterCountry() instanceof Country) {
+                       // Get managed instance back
+                       final Country managedCountry = this.createManaged(headquarter.getHeadquarterCountry());
+
+                       // Set it back in branch office
+                       headquarter.setHeadquarterCountry(managedCountry);
+               }
+
+               // Set "created" timestamp on any number assigned
+               this.setAllPhoneEntriesCreated(headquarter);
+
+               // Get opening times
+               final List<OpeningTime> openingTimes = headquarter.getHeadquarterOpeningTimes();
+
+               // Debugging:
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.addHeadquarter(): headquarter.headquarterOpeningTimes={1}", this.getClass().getSimpleName(), openingTimes));
+
+               // Is opening times set and not empty?
+               if ((openingTimes instanceof List) && (!openingTimes.isEmpty())) {
+                       // Add created timestamp for all times
+                       this.setAllOpeningTimesCreated(openingTimes);
+               } else {
+                       // Set all to null
+                       headquarter.setHeadquarterOpeningTimes(null);
+               }
+
+               // Persist it
+               this.getEntityManager().persist(headquarter);
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter.branchId={1} - EXIT!", this.getClass().getSimpleName(), headquarter.getHeadquarterId())); //NOI18N
+
+               // Return updated instance
+               return headquarter;
+       }
+
+       /**
+        * Checks if given branch office's address is already persisted. The whole
+        * (persisted) list is being loaded and each address is being matched
+        * against the given branch office's address.
+        * <p>
+        * @param headquarter Headquarter office being checked
+        * <p>
+        * @return Whether it has been found
+        */
+       private boolean isHeadquarterFound (final Headquarter headquarter) {
+               // Get whole list
+               final List<Headquarter> headquarters = this.headquarterBean.allHeadquarters();
+
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all single addresses
+               for (final Headquarter hq : headquarters) {
+                       // Is the same address found?
+                       if (Headquarters.isSameAddress(hq, headquarter)) {
+                               // Found one
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+}
diff --git a/src/java/org/mxchange/jcontactsbusiness/model/headquarter/FinancialsHeadquarterSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/headquarter/FinancialsHeadquarterSessionBean.java
new file mode 100644 (file)
index 0000000..066a87f
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2017, 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
+ * 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontactsbusiness.model.headquarter;
+
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import java.text.MessageFormat;
+import java.util.List;
+import javax.ejb.Stateless;
+import javax.persistence.Query;
+import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
+import org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote;
+
+/**
+ * A stateless session bean for general headquarter purposes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "headquarter", description = "A general statless bean for handling headquarter data (all)")
+public class FinancialsHeadquarterSessionBean extends BaseFinancialsDatabaseBean implements HeadquarterSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 58_467_386_571_701L;
+
+       @Override
+       @SuppressWarnings ("unchecked")
+       public List<Headquarter> allHeadquarters () {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
+               // Get query
+               final Query query = this.getEntityManager().createNamedQuery("AllHeadquarters"); //NOI18N
+
+               // Get list from it
+               final List<Headquarter> list = query.getResultList();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+
+               // Return it
+               return list;
+       }
+
+}
diff --git a/src/java/org/mxchange/jcontactsbusiness/model/headquarters/FinancialsAdminHeadquartersSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/headquarters/FinancialsAdminHeadquartersSessionBean.java
deleted file mode 100644 (file)
index e066c45..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcontactsbusiness.model.headquarters;
-
-import java.text.MessageFormat;
-import java.util.Date;
-import java.util.List;
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import org.mxchange.jcontactsbusiness.exceptions.headquarters.HeadquartersAlreadyAddedException;
-import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
-import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A stateless session bean for administrative branch office purposes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Stateless (name = "adminHeadquarters", description = "An administrative statless bean for handling branch office data (all)")
-public class FinancialsAdminHeadquartersSessionBean extends BaseFinancialsDatabaseBean implements AdminHeadquartersSessionBeanRemote {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 58_467_386_571_701L;
-
-       /**
-        * General branch office bean
-        */
-       @EJB (lookup = "java:global/jfinancials-ejb/headquarters!org.mxchange.jcontactsbusiness.model.headquarters.HeadquarterSessionBeanRemote")
-       private HeadquartersSessionBeanRemote headquartersBean;
-
-       /**
-        * Default constructor
-        */
-       public FinancialsAdminHeadquartersSessionBean () {
-               // Call super constructor
-               super();
-       }
-
-       @Override
-       public Headquarter addHeadquarters (final Headquarter headquarter) throws HeadquartersAlreadyAddedException {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarters(): headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
-
-               // Validate parameter
-               if (null == headquarter) {
-                       // Throw NPE
-                       throw new NullPointerException("headquarter is null"); //NOI18N
-               } else if (headquarter.getHeadquartersId() instanceof Long) {
-                       // Should not happen
-                       throw new IllegalArgumentException("headquarter.branchId should not be set."); //NOI18N
-               } else if (this.isHeadquarterFound(headquarter)) {
-                       // Already added, abort here
-                       throw new HeadquartersAlreadyAddedException(headquarter);
-               }
-
-               // Add created timestamp
-               headquarter.setHeadquartersCreated(new Date());
-
-               // Is user instance set?
-               if (headquarter.getHeadquartersUserOwner() instanceof User) {
-                       // Get managed instance back
-                       final User managedUser = this.createManaged(headquarter.getHeadquartersUserOwner());
-
-                       // Set it back in branch office
-                       headquarter.setHeadquartersUserOwner(managedUser);
-               }
-
-               // Is user instance set?
-               if (headquarter.getHeadquartersCountry() instanceof Country) {
-                       // Get managed instance back
-                       final Country managedCountry = this.createManaged(headquarter.getHeadquartersCountry());
-
-                       // Set it back in branch office
-                       headquarter.setHeadquartersCountry(managedCountry);
-               }
-
-               // Set "created" timestamp on any number assigned
-               this.setAllPhoneEntriesCreated(headquarter);
-
-               // Get opening times
-               final List<OpeningTime> openingTimes = headquarter.getHeadquartersOpeningTimes();
-
-               // Debugging:
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.addHeadquarters(): headquarter.headquarterOpeningTimes={1}", this.getClass().getSimpleName(), openingTimes));
-
-               // Is opening times set and not empty?
-               if ((openingTimes instanceof List) && (!openingTimes.isEmpty())) {
-                       // Add created timestamp for all times
-                       this.setAllOpeningTimesCreated(openingTimes);
-               } else {
-                       // Set all to null
-                       headquarter.setHeadquartersOpeningTimes(null);
-               }
-
-               // Persist it
-               this.getEntityManager().persist(headquarter);
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarters(): headquarter.branchId={1} - EXIT!", this.getClass().getSimpleName(), headquarter.getHeadquartersId())); //NOI18N
-
-               // Return updated instance
-               return headquarter;
-       }
-
-       /**
-        * Checks if given branch office's address is already persisted. The whole
-        * (persisted) list is being loaded and each address is being matched
-        * against the given branch office's address.
-        * <p>
-        * @param headquarter Headquarters office being checked
-        * <p>
-        * @return Whether it has been found
-        */
-       private boolean isHeadquarterFound (final Headquarter headquarter) {
-               // Get whole list
-               final List<Headquarter> headquarters = this.headquartersBean.allHeadquarters();
-
-               // Default is not found
-               boolean isFound = false;
-
-               // Check all single addresses
-               for (final Headquarter hq : headquarters) {
-                       // Is the same address found?
-                       if (Headquarters.isSameAddress(hq, headquarter)) {
-                               // Found one
-                               isFound = true;
-                               break;
-                       }
-               }
-
-               // Return flag
-               return isFound;
-       }
-
-}
diff --git a/src/java/org/mxchange/jcontactsbusiness/model/headquarters/FinancialsHeadquartersSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/headquarters/FinancialsHeadquartersSessionBean.java
deleted file mode 100644 (file)
index 76e671f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcontactsbusiness.model.headquarters;
-
-import java.text.MessageFormat;
-import java.util.List;
-import javax.ejb.Stateless;
-import javax.persistence.Query;
-import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
-
-/**
- * A stateless session bean for general headquarters purposes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Stateless (name = "headquarters", description = "A general statless bean for handling headquarters data (all)")
-public class FinancialsHeadquartersSessionBean extends BaseFinancialsDatabaseBean implements HeadquartersSessionBeanRemote {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 58_467_386_571_701L;
-
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<Headquarter> allHeadquarters () {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Get query
-               final Query query = this.getEntityManager().createNamedQuery("AllHeadquarters"); //NOI18N
-
-               // Get list from it
-               final List<Headquarter> list = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
-
-               // Return it
-               return list;
-       }
-
-}
index 4f1468ae24935062da421443683307865f5ffd50..3ed9a52d75ffe8102a72b6f2e85001eeb44fbd7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
index b7553ad2c0b728426e90bb4d6b247000b7260e4e..b8ebb9372e1f8c7919286bf6da8835ecbeccfcba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
index 792b8d325e50801e6064240a9f128383b55b7fe4..bf359650fa16e376b728f858fd8155dd9beeec6f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index db6025dc1915f968d37098b0e49e161295ee48a8..fcd55f2d70bb3ddcf73f8658dfa6ec9ed80c3362 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index ee3c22bcf325ea106a553092bcf317f2c1cbe0a2..7fea5b7f106514584cfef4b1efdc0077080fb40a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index 4208c687701f253f62eaf41eb3087e620297b1ba..c03be8ab1ec55aef23fdfe92021b4524ec5cb28e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index be388f83884e75da8e298d0d070652ce06051076..4e8ba4d3689c5e09619c6064d2f822fec1f5c0c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index 7583b4fabbbb5c81c96bf206bef57eca3eec29d2..42f1d5708459048b320321fb6756a81b4cc39cd8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index aa4483bddd9e921d03e33a72dd4fe13241d81bee..93950bd03ae1f72edf301899cb4cd91530f8c703 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
index b33479d1e4c7df6163c240dee3097d5ea2bf67f3..bef0b5bead23a049e59d96f924e8782e44e1317e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
index 44767567a26d900ed8d2de163ceff8fba7a915f1..0287935ac0123ca010b5f21fc35373c6d5db1b98 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
@@ -73,12 +73,12 @@ public class FinancialsAdminGenericProductSessionBean extends BaseFinancialsProd
                } else if (product.getProductCategory().getCategoryId() < 1) {
                        // Throw IAE
                        throw new IllegalArgumentException(MessageFormat.format("product.productCategory.categoryId={0} is invalid", product.getProductCategory().getCategoryId())); //NOI18N
-               } else if ((product.getProductManfacturer() instanceof BasicData) && (product.getProductManfacturer().getBasicDataId() == null)) {
+               } else if ((product.getProductManufacturer() instanceof BasicData) && (product.getProductManufacturer().getBasicDataId() == null)) {
                        // Throw NPE
                        throw new NullPointerException("product.productManufacturer.basicDataId is null"); //NOI18N
-               } else if ((product.getProductManfacturer() instanceof BasicData) && (product.getProductManfacturer().getBasicDataId() < 1)) {
+               } else if ((product.getProductManufacturer() instanceof BasicData) && (product.getProductManufacturer().getBasicDataId() < 1)) {
                        // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("product.productManufacturer.basicDataId={0} is invalid", product.getProductManfacturer().getBasicDataId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("product.productManufacturer.basicDataId={0} is invalid", product.getProductManufacturer().getBasicDataId())); //NOI18N
                } else if (this.isProductCreated(product)) {
                        // Is already created (by name)
                        throw new ProductAlreadyAddedException(product);
@@ -91,12 +91,12 @@ public class FinancialsAdminGenericProductSessionBean extends BaseFinancialsProd
                product.setProductCategory(managedCategory);
 
                // Is a manufacturer (basic_data entity) set?
-               if (product.getProductManfacturer() instanceof BasicData) {
+               if (product.getProductManufacturer() instanceof BasicData) {
                        // Get managed instance from it
-                       final BasicData managedBasicData = this.createManaged(product.getProductManfacturer());
+                       final BasicData managedBasicData = this.createManaged(product.getProductManufacturer());
 
                        // Set it back
-                       product.setProductManfacturer(managedBasicData);
+                       product.setProductManufacturer(managedBasicData);
                }
 
                // Set created instance
index 12c50bf0bfd654b200f29dceb56d7bc25d68c9da..0ef070cfc0cd752f5f421799b64938aabe9dd52b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 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
index 3460b43c6f3157ecfc4f29942f105c9226d86dde..290306726dc6db48976d5273edd4418e9d136b47 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
@@ -62,7 +62,7 @@ public class FinancialsAdminUserSessionBean extends BaseFinancialsDatabaseBean i
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addUser: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
-               // user should not be null
+               // Validate parameter
                if (null == user) {
                        // Abort here
                        throw new NullPointerException("user is null"); //NOI18N
@@ -102,7 +102,7 @@ public class FinancialsAdminUserSessionBean extends BaseFinancialsDatabaseBean i
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteUser: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
-               // user should not be null
+               // Validate parameters
                if (null == user) {
                        // Abort here
                        throw new NullPointerException("user is null"); //NOI18N
index c02e8a6399cddac00a30abaf103870583ddf466c..fa471e016d5cda36bcbe2c41943575af0610a5d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
@@ -40,7 +40,6 @@ import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
 import org.mxchange.jusercore.model.user.password_history.UserPasswordHistory;
-import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
 
@@ -73,53 +72,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
 
        @Override
        @SuppressWarnings ("unchecked")
-       public List<User> allMemberPublicVisibleUsers () {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMemberPublicVisibleUsers: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Get named query
-               final Query query = this.getEntityManager().createNamedQuery("AllMemberPublicUsers", LoginUser.class); //NOI18N
-
-               // Set parameters
-               query.setParameter("status", UserAccountStatus.CONFIRMED); //NOI18N
-               query.setParameter("members", ProfileMode.MEMBERS); //NOI18N
-               query.setParameter("public", ProfileMode.PUBLIC); //NOI18N
-
-               // Get result
-               final List<User> users = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMemberPublicVisibleUsers: users.size()={1} - EXIT!", this.getClass().getSimpleName(), users.size())); //NOI18N
-
-               // Return full list
-               return users;
-       }
-
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<User> allPublicUsers () {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allPublicUsers: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Get named query
-               final Query query = this.getEntityManager().createNamedQuery("AllPublicUsers", LoginUser.class); //NOI18N
-
-               // Set parameters
-               query.setParameter("status", UserAccountStatus.CONFIRMED); //NOI18N
-               query.setParameter("mode", ProfileMode.PUBLIC); //NOI18N
-
-               // Get result
-               final List<User> users = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allPublicUsers: users.size()={1} - EXIT!", this.getClass().getSimpleName(), users.size())); //NOI18N
-
-               // Return full list
-               return users;
-       }
-
-       @Override
-       @SuppressWarnings ("unchecked")
+       @Deprecated
        public List<String> allUserNames () {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getUserNameList: CALLED!", this.getClass().getSimpleName())); //NOI18N
@@ -201,6 +154,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
        }
 
        @Override
+       @Deprecated
        public User fillUserData (final User user) throws UserNotFoundException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fillUserData: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
@@ -247,6 +201,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
        }
 
        @Override
+       @Deprecated
        public String generateRandomUserName () {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.generateRandomUserName - CALLED!", this.getClass().getSimpleName())); //NOI18N
@@ -271,25 +226,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
        }
 
        @Override
-       @SuppressWarnings ("unchecked")
-       public List<String> getEmailAddressList () {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getEmailAddressList: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Get query
-               final Query query = this.getEntityManager().createNamedQuery("AllEmailAddresses", String.class); //NOI18N
-
-               // Get result list
-               final List<String> emailAddressList = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getEmailAddressList: emailAddressList.size()={1} - EXIT!", this.getClass().getSimpleName(), emailAddressList.size())); //NOI18N
-
-               // Return it
-               return emailAddressList;
-       }
-
-       @Override
+       @Deprecated
        public boolean ifUserExists (final User user) {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.ifUserExists: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
index dcbf1d88d8bfadd1bd1d3deb8153fd8c30ccb975..e31c1ccff46bc08acf3bd93fc4eed03b96f83f77 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
diff --git a/src/java/org/mxchange/jusercore/model/user/activity/FinancialsUserActivitySessionBean.java b/src/java/org/mxchange/jusercore/model/user/activity/FinancialsUserActivitySessionBean.java
new file mode 100644 (file)
index 0000000..12ac739
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2017 Roland Haeder<roland@mxchange.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jusercore.model.user.activity;
+
+import java.text.MessageFormat;
+import java.util.List;
+import javax.ejb.EJBException;
+import javax.ejb.Stateless;
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.persistence.Query;
+import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A stateless, session-scoped EJB for user-activity
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "userActivity", description = "A stateless, session-scored user-activity bean.")
+public class FinancialsUserActivitySessionBean extends BaseFinancialsDatabaseBean implements UserActivityLogSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 1_268_376_401_659L;
+
+       /**
+        * Default constructor
+        */
+       public FinancialsUserActivitySessionBean () {
+               // Invoke super constructor
+               super("jms/jfinancials-queue-factory", "jms/jfinancials-user-activity-log"); //NOI18N
+       }
+
+       @Override
+       public void addUserActivityLog (final LogableUserActivity userActivity) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addUserActivityLog: userActivity={1} - CALLED!", this.getClass().getSimpleName(), userActivity)); //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) {
+                       // 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
+               }
+
+               try {
+                       // Send out email change
+                       final ObjectMessage message = this.getSession().createObjectMessage();
+                       message.setObject(userActivity);
+
+                       // Send message
+                       this.sendMessage(message);
+               } catch (final JMSException ex) {
+                       // Throw again
+                       throw new EJBException(ex);
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addUserActivityLog: EXIT!", this.getClass().getSimpleName())); //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
+
+               // Return it
+               return list;
+       }
+
+       @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
+               }
+
+               // Get named query
+               final Query query = this.getEntityManager().createNamedQuery("SearchAllUsersActivity"); //NOI18N
+
+               // Set parameter
+               query.setParameter("activityUser", user); //NOI18N
+
+               // Get list from it
+               List<LogableUserActivity> list = query.getResultList();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUsersActivityLog: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+
+               // Return it
+               return list;
+       }
+
+}
index 845cb1d8c6421e08c0ed5f0f50765d505f2aabc5..57941c8f73888f6792b0c353469c88041aa65b24 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index 216666176a41261622c907f024530f043eaa394b..e52c92adec6b7080457aba8a7a2053dfa2a94d6d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index 11f794370afe1164cb4c1e4b030262a3f6300f92..e18590692476dbd49a3239b21f8a22070e61ef3f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
@@ -84,6 +84,7 @@ public class FinancialsUserLoginSessionBean extends BaseFinancialsDatabaseBean i
                }
 
                // Get user instance from persistance
+               // @TODO Rewrite this to use JCache instead
                final User updatedUser = this.userBean.fillUserData(container.getUser());
 
                // Debug message
index e14efabd79ec081a39d248a9c3d0a47843f9e8c9..a186fe8569ed714f6fdc4ad22c0cb68e9947aa15 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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
index 6eaaee5c209db03121874f384e85d3c352aabe34..f85e397926d6e5aae4620440f3b971eec96f1ddc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * 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