]> git.mxchange.org Git - jjobs-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 22 Sep 2017 22:20:50 +0000 (00:20 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 19 Jul 2019 21:40:57 +0000 (23:40 +0200)
- need to change java.util.Calendar (bye bye) to java.util.Date in favour of
  PrimeFaces' p:calendar [!] tag

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jcontacts/model/contact/JobsAdminContactSessionBean.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/branchoffice/JobsAdminBranchOfficeSessionBean.java
src/java/org/mxchange/jcountry/model/data/JobsCountrySingletonBean.java
src/java/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java
src/java/org/mxchange/jphone/model/phonenumbers/mobileprovider/JobsAdminMobileProviderSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/phone/JobsAdminPhoneSessionBean.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/email_address/JobsUserEmailChangeSessionBean.java

index 190c84b0fc2fec8a18e28742ef99e0f612b8abee..8c279baecf84a54bee289625a723f7b184ddda3a 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcontacts.model.contact;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
@@ -64,7 +64,7 @@ public class JobsAdminContactSessionBean extends BaseJobsDatabaseBean implements
                }
 
                // Set created timestamp
-               contact.setContactCreated(new GregorianCalendar());
+               contact.setContactCreated(new Date());
 
                // Set all created timestamps, if instance is there
                this.setAllContactPhoneEntriesCreated(contact);
index 0555707d1bc6996b12564df210b1e1896eea066e..c215fc79327d43f7bd2a45de8ab3eaec5fadca53 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcontacts.model.phone;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.Objects;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
@@ -260,7 +260,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
                }
 
                // Set created instance
-               faxNumber.setPhoneEntryCreated(new GregorianCalendar());
+               faxNumber.setPhoneEntryCreated(new Date());
 
                // Set fax number in contact
                contact.setContactFaxNumber(faxNumber);
@@ -317,7 +317,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
                }
 
                // Set created instance
-               landLineNumber.setPhoneEntryCreated(new GregorianCalendar());
+               landLineNumber.setPhoneEntryCreated(new Date());
 
                // Set landLine number in contact
                contact.setContactLandLineNumber(landLineNumber);
@@ -368,7 +368,7 @@ public class JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
                }
 
                // Set created instance
-               mobileNumber.setPhoneEntryCreated(new GregorianCalendar());
+               mobileNumber.setPhoneEntryCreated(new Date());
 
                // Set mobile number in contact
                contact.setContactMobileNumber(mobileNumber);
index 7e45d7919c9d6517ff94e69acb2003fd188b94d9..61818b5746ab1ed12b45713eb29bca0a9347a85a 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcontactsbusiness.model.basicdata;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 import javax.ejb.EJB;
@@ -72,7 +72,7 @@ public class JobsAdminBusinessDataSessionBean extends BaseJobsDatabaseBean imple
                }
 
                // Now add current date
-               basicData.setCompanyCreated(new GregorianCalendar());
+               basicData.setCompanyCreated(new Date());
 
                // Is there a owner set?
                if (basicData.getCompanyUserOwner() instanceof User) {
index c3f8803003ee6351e38f4501650d5e3cd722b0f0..dfcddb3180a5b0a21104e509474619c8c89aa680 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcontactsbusiness.model.branchoffice;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.List;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
@@ -70,7 +70,7 @@ public class JobsAdminBranchOfficeSessionBean extends BaseJobsDatabaseBean imple
                }
 
                // Add created timestamp
-               branchOffice.setBranchCreated(new GregorianCalendar());
+               branchOffice.setBranchCreated(new Date());
 
                // Is user instance set?
                if (branchOffice.getBranchCompany() instanceof org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData) {
index 8629f055104b53d9460e14ae9973c0ca935a5462..26c3b6df7e442a18b564acb368cd48e06895b0c6 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jcountry.model.data;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.List;
 import javax.ejb.Singleton;
 import javax.ejb.Startup;
@@ -72,7 +72,7 @@ public class JobsCountrySingletonBean extends BaseJobsDatabaseBean implements Co
                }
 
                // Add timestamp
-               country.setCountryEntryCreated(new GregorianCalendar());
+               country.setCountryEntryCreated(new Date());
 
                // It is not added, so persist it
                this.getEntityManager().persist(country);
index 5187f1206dd83b7dc3fea5498771319bf941fc67..1b21d2d6067f2fda4d4b32879f91eed895669592 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jjobs.database;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.Objects;
 import java.util.Properties;
 import javax.ejb.EJBException;
@@ -109,7 +109,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean {
                        this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for land-line number ...", this.getClass().getSimpleName())); //NOI18N
 
                        // Set updated timestamp
-                       landLineNumber.setPhoneEntryCreated(new GregorianCalendar());
+                       landLineNumber.setPhoneEntryCreated(new Date());
                }
 
                // Is a fax number instance set?
@@ -118,7 +118,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean {
                        this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for fax number ...", this.getClass().getSimpleName())); //NOI18N
 
                        // Set updated timestamp
-                       faxNumber.setPhoneEntryCreated(new GregorianCalendar());
+                       faxNumber.setPhoneEntryCreated(new Date());
                }
 
                // Is a mobile number instance set?
@@ -127,7 +127,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean {
                        this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesCreated: Setting created timestamp for mobile number ...", this.getClass().getSimpleName())); //NOI18N
 
                        // Set updated timestamp
-                       mobileNumber.setPhoneEntryCreated(new GregorianCalendar());
+                       mobileNumber.setPhoneEntryCreated(new Date());
                }
 
                // Trace message
@@ -499,6 +499,9 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean {
                        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());
 
@@ -881,7 +884,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean {
                        this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for land-line number ...", this.getClass().getSimpleName())); //NOI18N
 
                        // Set updated timestamp
-                       landLineNumber.setPhoneEntryUpdated(new GregorianCalendar());
+                       landLineNumber.setPhoneEntryUpdated(new Date());
                }
 
                // Is a fax number instance set?
@@ -890,7 +893,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean {
                        this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for fax number ...", this.getClass().getSimpleName())); //NOI18N
 
                        // Set updated timestamp
-                       faxNumber.setPhoneEntryUpdated(new GregorianCalendar());
+                       faxNumber.setPhoneEntryUpdated(new Date());
                }
 
                // Is a mobile number instance set?
@@ -899,7 +902,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean {
                        this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.setAllContactPhoneEntriesUpdated: Setting updated timestamp for mobile number ...", this.getClass().getSimpleName())); //NOI18N
 
                        // Set updated timestamp
-                       mobileNumber.setPhoneEntryUpdated(new GregorianCalendar());
+                       mobileNumber.setPhoneEntryUpdated(new Date());
                }
 
                // Trace message
index 22e4489bf9d205c342c241fd07b24a594955c791..603f14a0b3573b8aba46cd17fa353b188fb2c512 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jphone.model.phonenumbers.mobileprovider;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import javax.ejb.Stateless;
 import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
 import org.mxchange.jphone.exceptions.MobileProviderAlreadyAddedException;
@@ -79,7 +79,7 @@ public class JobsAdminMobileProviderSessionBean extends BaseJobsDatabaseBean imp
                }
 
                // Set creation timestamp
-               mobileProvider.setProviderEntryCreated(new GregorianCalendar());
+               mobileProvider.setProviderEntryCreated(new Date());
 
                // Persist it
                this.getEntityManager().persist(mobileProvider);
index 9b387f6715cc2edf7525d8e59a87524ee22b6f4a..8607fbb9dbf99c7b1bc590b411048232e7ec7242 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jphone.model.phonenumbers.phone;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import javax.ejb.Stateless;
 import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
 import org.mxchange.jphone.model.phonenumbers.phone.AdminPhoneSessionBeanRemote;
@@ -229,8 +229,8 @@ public class JobsAdminPhoneSessionBean extends BaseJobsDatabaseBean implements A
                this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateFaxData: managedNumber.phoneId={1}", this.getClass().getSimpleName(), managedNumber.getPhoneId())); //NOI18N
 
                // Set updated timestamp
-               org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers.copyAll(faxNumber, managedNumber);
-               managedNumber.setPhoneEntryUpdated(new GregorianCalendar());
+               FaxNumbers.copyAll(faxNumber, managedNumber);
+               managedNumber.setPhoneEntryUpdated(new Date());
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateFaxData: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), managedNumber)); //NOI18N
@@ -287,8 +287,8 @@ public class JobsAdminPhoneSessionBean extends BaseJobsDatabaseBean implements A
                this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateLandLineData: managedNumber.phoneId={1}", this.getClass().getSimpleName(), managedNumber.getPhoneId())); //NOI18N
 
                // Set updated timestamp
-               org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers.copyAll(landLineNumber, managedNumber);
-               managedNumber.setPhoneEntryUpdated(new GregorianCalendar());
+               LandLineNumbers.copyAll(landLineNumber, managedNumber);
+               managedNumber.setPhoneEntryUpdated(new Date());
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateLandLineData: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), managedNumber)); //NOI18N
@@ -339,8 +339,8 @@ public class JobsAdminPhoneSessionBean extends BaseJobsDatabaseBean implements A
                this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateMobileData: managedNumber.phoneId={1}", this.getClass().getSimpleName(), managedNumber.getPhoneId())); //NOI18N
 
                // Set updated timestamp
-               org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers.copyAll(mobileNumber, managedNumber);
-               managedNumber.setPhoneEntryUpdated(new GregorianCalendar());
+               MobileNumbers.copyAll(mobileNumber, managedNumber);
+               managedNumber.setPhoneEntryUpdated(new Date());
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateMobileData: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), managedNumber)); //NOI18N
index fac2bbd41955553d7ef3ddb6446cdd42be418ef1..c0fb24e25545ca61ebff1e013dfb1dec270ba98b 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jusercore.model.user;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import org.mxchange.jcontacts.model.contact.Contact;
@@ -88,8 +88,8 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad
                }
 
                // Set created timestamp
-               user.setUserCreated(new GregorianCalendar());
-               user.getUserContact().setContactCreated(new GregorianCalendar());
+               user.setUserCreated(new Date());
+               user.getUserContact().setContactCreated(new Date());
 
                // Update mobile, land-line and fax instance
                this.setAllContactPhoneEntriesCreated(user.getUserContact());
@@ -185,7 +185,7 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad
                user.setUserContact(foundContact);
 
                // Set timestamp
-               user.setUserCreated(new GregorianCalendar());
+               user.setUserCreated(new Date());
 
                // Perist it
                this.getEntityManager().persist(user);
@@ -246,7 +246,7 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad
 
                // Set as locked, set timestamp and lock reason
                user.setUserAccountStatus(UserAccountStatus.LOCKED);
-               user.setUserLastLocked(new GregorianCalendar());
+               user.setUserLastLocked(new Date());
                user.setUserLastLockedReason(userLockReason);
 
                // Update user
index e4a65fada66e9c0474404bdd809eaedb29c6a6a3..9d29a403d2400737c5045069e46f36bd8052d845 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jusercore.model.user;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.List;
 import javax.ejb.EJB;
 import javax.ejb.EJBException;
@@ -194,7 +194,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                // Update user status and remove confirmation key
                managedUser.setUserAccountStatus(UserAccountStatus.CONFIRMED);
                managedUser.setUserConfirmKey(null);
-               managedUser.setUserUpdated(new GregorianCalendar());
+               managedUser.setUserUpdated(new Date());
 
                // Send out email
                this.sendEmail("User account confirmed", "user_account_confirmed", managedUser, baseUrl, null); //NOI18N
@@ -598,7 +598,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                UserUtils.copyAll(user, managedUser);
 
                // Set as updated
-               managedUser.setUserUpdated(new GregorianCalendar());
+               managedUser.setUserUpdated(new Date());
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserData: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N
@@ -658,13 +658,13 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                final User managedUser = this.updateUserData(user);
 
                // Update user account
-               managedUser.setUserUpdated(new GregorianCalendar());
+               managedUser.setUserUpdated(new Date());
 
                // Create history entry
                PasswordHistory entry = new UserPasswordHistory(user.getUserEncryptedPassword(), managedUser);
 
                // Set created timestamp
-               entry.setUserPasswordHistoryCreated(new GregorianCalendar());
+               entry.setUserPasswordHistoryCreated(new Date());
 
                // Merge user to make sure it is not re-persisted
                final User mergedUser = this.getEntityManager().merge(managedUser);
@@ -716,8 +716,8 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                UserUtils.copyAll(user, managedUser);
 
                // Set as updated
-               managedUser.setUserUpdated(new GregorianCalendar());
-               managedUser.getUserContact().setContactUpdated(new GregorianCalendar());
+               managedUser.setUserUpdated(new Date());
+               managedUser.getUserContact().setContactUpdated(new Date());
 
                // Get contact from it and find it
                final Contact foundContact = this.getEntityManager().find(managedUser.getUserContact().getClass(), managedUser.getUserContact().getContactId());
index 3f7b67751d859fa4ebb4ce1c71027967883ad3ea..9fc05f6cbe7fc58a42de4f2ff395bf1ff58dd072 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jusercore.model.user.email_address;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.List;
 import javax.ejb.EJB;
 import javax.ejb.EJBException;
@@ -106,7 +106,7 @@ public class JobsUserEmailChangeSessionBean extends BaseJobsDatabaseBean impleme
                }
 
                // The email change is not (yet) there, add secure hash and "created" timestamp
-               emailChange.setEmailChangeCreated(new GregorianCalendar());
+               emailChange.setEmailChangeCreated(new Date());
                this.generateSecureHash(emailChange);
 
                // Make user managed