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;
}
// Set created timestamp
- contact.setContactCreated(new GregorianCalendar());
+ contact.setContactCreated(new Date());
// Set all created timestamps, if instance is there
this.setAllContactPhoneEntriesCreated(contact);
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;
}
// Set created instance
- faxNumber.setPhoneEntryCreated(new GregorianCalendar());
+ faxNumber.setPhoneEntryCreated(new Date());
// Set fax number in contact
contact.setContactFaxNumber(faxNumber);
}
// Set created instance
- landLineNumber.setPhoneEntryCreated(new GregorianCalendar());
+ landLineNumber.setPhoneEntryCreated(new Date());
// Set landLine number in contact
contact.setContactLandLineNumber(landLineNumber);
}
// Set created instance
- mobileNumber.setPhoneEntryCreated(new GregorianCalendar());
+ mobileNumber.setPhoneEntryCreated(new Date());
// Set mobile number in contact
contact.setContactMobileNumber(mobileNumber);
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;
}
// Now add current date
- basicData.setCompanyCreated(new GregorianCalendar());
+ basicData.setCompanyCreated(new Date());
// Is there a owner set?
if (basicData.getCompanyUserOwner() instanceof User) {
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;
}
// 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) {
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;
}
// Add timestamp
- country.setCountryEntryCreated(new GregorianCalendar());
+ country.setCountryEntryCreated(new Date());
// It is not added, so persist it
this.getEntityManager().persist(country);
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;
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?
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?
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
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());
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?
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?
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
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;
}
// Set creation timestamp
- mobileProvider.setProviderEntryCreated(new GregorianCalendar());
+ mobileProvider.setProviderEntryCreated(new Date());
// Persist it
this.getEntityManager().persist(mobileProvider);
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;
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
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
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
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;
}
// 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());
user.setUserContact(foundContact);
// Set timestamp
- user.setUserCreated(new GregorianCalendar());
+ user.setUserCreated(new Date());
// Perist it
this.getEntityManager().persist(user);
// 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
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;
// 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
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
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);
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());
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;
}
// 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