Exemple #1
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#getUser(java.lang.String
   * , boolean)
   */
  @Transactional(readOnly = true)
  public User getUserWithDependent(String id, boolean dependants) {

    UserEntity usr = userDao.findById(id);
    if (usr == null) {
      return null;
    }

    if (!dependants) {
      return userDozerConverter.convertToDTO(usr, true);
    }

    // assemble the various dependant objects
    org.hibernate.Hibernate.initialize(usr.getPhones());
    org.hibernate.Hibernate.initialize(usr.getEmailAddresses());
    org.hibernate.Hibernate.initialize(usr.getAddresses());
    org.hibernate.Hibernate.initialize(usr.getUserAttributes());
    User user = userDozerConverter.convertToDTO(usr, true);
    List<Login> principalList = loginDao.findUser(id);
    if (principalList != null) {
      user.setPrincipalList(principalList);
    }

    return user;
  }
Exemple #2
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.openiam.idm.srvc.user.service.UserDataService#getSupervisors(java
  * .lang.String)
  */
 @Transactional(readOnly = true)
 public List<Supervisor> getSupervisors(String employeeId) {
   if (employeeId == null) throw new NullPointerException("employeeId is null");
   List<SupervisorEntity> superVisList = supervisorDao.findSupervisors(employeeId);
   List<Supervisor> supervisorList = new LinkedList<Supervisor>();
   for (SupervisorEntity sup : superVisList) {
     org.hibernate.Hibernate.initialize(sup.getSupervisor().getPhones());
     org.hibernate.Hibernate.initialize(sup.getSupervisor().getEmailAddresses());
     org.hibernate.Hibernate.initialize(sup.getSupervisor().getAddresses());
     org.hibernate.Hibernate.initialize(sup.getSupervisor().getUserAttributes());
     supervisorList.add(supervisorDozerConverter.convertToDTO(sup, true));
   }
   return supervisorList;
 }