import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
+import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeAlreadyAddedException;
import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeNotFoundException;
import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
// Add created timestamp
branchOffice.setBranchEntryCreated(new Date());
+ // Is contact employee set?
+ if (branchOffice.getBranchContactEmployee() instanceof Contact) {
+ // Get managed lead contact
+ final Contact managedContact = this.createManaged(branchOffice.getBranchContactEmployee());
+
+ // Set it back
+ branchOffice.setBranchContactEmployee(managedContact);
+ }
+
+ // Is owner employee set?
+ if (branchOffice.getBranchOwnerEmployee() instanceof Contact) {
+ // Get managed lead contact
+ final Contact managedContact = this.createManaged(branchOffice.getBranchOwnerEmployee());
+
+ // Set it back
+ branchOffice.setBranchOwnerEmployee(managedContact);
+ }
+
// Is user instance set?
if (branchOffice.getBranchCompany() instanceof BasicData) {
// Get managed instance back
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
+import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException;
import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
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.enterprise.BaseFinancialsEnterpriseBean;
import org.mxchange.jusercore.model.user.User;
}
// Is lead employee set?
- if (department.getDepartmentLead() instanceof Employable) {
- // Get managed lead employee
- final Employable managedEmployee = this.createManaged(department.getDepartmentLead());
+ if (department.getDepartmentLead() instanceof Contact) {
+ // Get managed lead contact
+ final Contact managedContact = this.createManaged(department.getDepartmentLead());
// Set it back
- department.setDepartmentLead(managedEmployee);
+ department.setDepartmentLead(managedContact);
}
// Is "owning" user set?
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
+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.jcountry.model.data.Country;
// Add created timestamp
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) {
// Get managed instance back