]> git.mxchange.org Git - jjobs-war.git/blobdiff - src/java/org/mxchange/jjobs/converter/business/department/JobsDepartmentConverter.java
Please cherry-pick:
[jjobs-war.git] / src / java / org / mxchange / jjobs / converter / business / department / JobsDepartmentConverter.java
index aa5f3e00a38210f6e86df0f524ba2444059729c0..3f2a1f47640b1c39cc73127ca89ad901127f4ca7 100644 (file)
@@ -24,8 +24,8 @@ import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
 import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
 import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jjobs.beans.business.department.JobsDepartmentWebRequestBean;
-import org.mxchange.jjobs.beans.business.department.JobsDepartmentWebRequestController;
+import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewBean;
+import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewController;
 
 /**
  * Converter for company department id <-> instance
@@ -38,16 +38,10 @@ public class JobsDepartmentConverter implements Converter<Department> {
        /**
         * Company department EJB
         */
-       private static JobsDepartmentWebRequestController DEPARTMENT_CONTROLLER;
+       private static JobsDepartmentListWebViewController DEPARTMENT_LIST_CONTROLLER;
 
        @Override
        public Department getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Is the instance there?
-               if (null == DEPARTMENT_CONTROLLER) {
-                       // Get bean from CDI directly
-                       DEPARTMENT_CONTROLLER = CDI.current().select(JobsDepartmentWebRequestBean.class).get();
-               }
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
@@ -64,8 +58,14 @@ public class JobsDepartmentConverter implements Converter<Department> {
                        // Try to parse the value as long
                        final Long departmentId = Long.valueOf(submittedValue);
 
+                       // Is the instance there?
+                       if (null == DEPARTMENT_LIST_CONTROLLER) {
+                               // Get bean from CDI directly
+                               DEPARTMENT_LIST_CONTROLLER = CDI.current().select(JobsDepartmentListWebViewBean.class).get();
+                       }
+
                        // Try to get user instance from it
-                       companyDepartment = DEPARTMENT_CONTROLLER.findDepartmentById(departmentId);
+                       companyDepartment = DEPARTMENT_LIST_CONTROLLER.findDepartmentById(departmentId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);