public User findById(int id) {
   User user = getByKey(id);
   if (user != null) {
     Hibernate.initialize(user.getUserProfiles());
   }
   return user;
 }
 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;
 }