result.add(new UzerProfile(uzer, profile));
}
}
}
} catch (Exception ex) {
throw new CustomException(ex);
}
try {
javax.persistence.Query q2 = entityManager.createQuery("SELECT p FROM " + IModel.DATABASE_PRE + "Profile p "
+ "where p.id not in(select u.profile.id as id from " + IModel.DATABASE_PRE + "Uzer u)");
for (Object o : q2.getResultList()) {
if (o instanceof Profile) {
Profile profile = (Profile) o;
result.add(new UzerProfile(null, profile));
}
}
} catch (Exception ex) {
throw new CustomException(ex);
}
switch (orderBy) {
case PROFILE_AND_THEN_UZER:
Collections.sort(result, new UzerProfileComparator());