Пример #1
0
 public User findById(int id) {
   User user = getByKey(id);
   if (user != null) {
     Hibernate.initialize(user.getUserProfiles());
   }
   return user;
 }
Пример #2
0
 public User findBySSO(String sso) {
   System.out.println("SSO: " + sso);
   Criteria crit = createEntityCriteria();
   crit.add(Restrictions.eq("ssoId", sso));
   User user = (User) crit.uniqueResult();
   if (user != null) {
     Hibernate.initialize(user.getUserProfiles());
   }
   return user;
 }