Package be.c4j.demo.security.demo.model

Examples of be.c4j.demo.security.demo.model.Department


        addDepartment(90L, "Executive");
        addDepartment(100L, "Finance");
    }

    private void addDepartment(Long id, String name) {
        Department department = new Department();
        department.setId(id);
        department.setName(name);
        departments.put(id, department);
    }
View Full Code Here


        return result;
    }

    private Department cloneDepartment(Department data) {
        Department result = new Department();
        result.setId(data.getId());
        result.setName(data.getName());
        //result.setManager(cloneEmployee(data.getManager()));
        return result;
    }
View Full Code Here

    public void updateEmployee(Employee employee) {
        employees.put(employee.getId(), employee);
    }

    public Department getDepartmentByName(String departmentName) {
        Department result = null;
        String basicName = departmentName.trim().toLowerCase();
        for (Department department  : departments.values()) {
            if (department.getName().toLowerCase().equals(basicName)) {
                result = department;
                break;
View Full Code Here

        return result;
    }

    @DemoPermissionCheck(DemoPermission.DEPARTMENT_CREATE)
    public void createDepartment(String departmentName) {
        Department departmentByName = data.getDepartmentByName(departmentName);
        if (departmentByName != null) {
            throw new DuplicateDepartmentException();
        }
        Department department = new Department();
        department.setName(departmentName);
        data.createDepartment(department);
    }
View Full Code Here

TOP

Related Classes of be.c4j.demo.security.demo.model.Department

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.