Unit departmentUnit = lastWorkingUnit.getDepartmentUnit(); if(departmentUnit != null && departmentUnit.getDepartment() != null ) { request.setAttribute("departmentRealName", lastWorkingUnit.getDepartmentUnit().getDepartment().getRealName()); }
    private void setWorkingUnit(HttpServletRequest request, OccupationPeriod occupationPeriod, Teacher teacher) {               if(occupationPeriod != null) {            Unit lastWorkingUnit = teacher.getLastWorkingUnit(occupationPeriod.getStartYearMonthDay(), occupationPeriod.getEndYearMonthDay());                       if(lastWorkingUnit != null) {                request.setAttribute("workingUnit", lastWorkingUnit);            }        }    }