public List < UserIdentification > listByUserAndAuthSource ( User user , AuthSource authSource ) { EntityManager entityManager = getEntityManager ( ) ; CriteriaBuilder criteriaBuilder = entityManager . getCriteriaBuilder ( ) ; CriteriaQuery < UserIdentification > criteria = criteriaBuilder . createQuery ( UserIdentification . class ) ; Root < UserIdentification > root = criteria . from ( UserIdentification . class ) ; criteria . select ( root ) ; criteria . where ( criteriaBuilder . and ( criteriaBuilder . equal ( root . get ( UserIdentification_ . user ) , user ) , criteriaBuilder . equal ( root . get ( UserIdentification_ . authSource ) , authSource ) ) ) ; return entityManager . createQuery ( criteria ) . getResultList ( ) ; }
Lists user identifications by user and auth source