import org.mxchange.jcontactsbusiness.model.employee.Employable;
import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
-import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
import org.mxchange.jcoreee.bean.ejb.BaseEnterpriseBean;
import org.mxchange.jcountry.model.data.Country;
}
/**
- * Get back a managed instance from given jobPosition
+ * Get back a managed instance from given job position
* <p>
* @param jobPosition Unmanaged/detached job position instance
* <p>
return managedHeadquarter;
}
- /**
- * Get back a managed instance from given job position
- * <p>
- * @param jobPosition Unmanaged/detached job position instance
- * <p>
- * @return Managed job position instance
- */
- protected JobPosition createManaged (final JobPosition jobPosition) {
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: jobPosition={1} - CALLED!", this.getClass().getSimpleName(), jobPosition)); //NOI18N
-
- // user should not be null
- if (null == jobPosition) {
- // Abort here
- throw new NullPointerException("jobPosition is null"); //NOI18N
- } else if (jobPosition.getJobPositionId() == null) {
- // Id is set
- throw new NullPointerException("jobPosition.jobPositionId is null"); //NOI18N
- } else if (jobPosition.getJobPositionId() < 1) {
- // Id is set
- throw new IllegalArgumentException(MessageFormat.format("jobPosition.jobPositionId={0} is invalid", jobPosition.getJobPositionId())); //NOI18N
- }
-
- // Try to find it (should be there)
- final JobPosition managedJobPosition = this.getEntityManager().find(jobPosition.getClass(), jobPosition.getJobPositionId());
-
- // Should be there
- assert (managedJobPosition instanceof JobPosition) : "managedJobPosition is null"; //NOI18N
-
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedJobPosition={1} - EXIT!", this.getClass().getSimpleName(), managedJobPosition)); //NOI18N
-
- // Return it
- return managedJobPosition;
- }
-
/**
* Get back a managed instance from given mobile provider
* <p>