import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
+import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
+import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterAlreadyAddedException;
import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
+import org.mxchange.jcontactsbusiness.model.utils.HeadquarterUtils;
import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
import org.mxchange.jusercore.model.user.User;
/**
}
// Add created timestamp
- headquarter.setHeadquarterCreated(new Date());
+ headquarter.setHeadquarterEntryCreated(new Date());
+
+ // Is contact employee set?
+ if (headquarter.getHeadquarterContactEmployee() instanceof Contact) {
+ // Get managed lead contact
+ final Contact managedContact = this.createManaged(headquarter.getHeadquarterContactEmployee());
+
+ // Set it back
+ headquarter.setHeadquarterContactEmployee(managedContact);
+ }
// Is user instance set?
if (headquarter.getHeadquarterUserOwner() instanceof User) {
// Check all single addresses
for (final Headquarter hq : headquarters) {
// Is the same address found?
- if (Headquarters.isSameAddress(hq, headquarter)) {
+ if (HeadquarterUtils.isSameAddress(hq, headquarter)) {
// Found one
isFound = true;
break;