Created
November 27, 2016 16:14
-
-
Save thjanssen/16c8cf4a787da8408d5f1422a346d59d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CriteriaBuilder cb = em.getCriteriaBuilder(); | |
CriteriaQuery q = cb.createQuery(AuthorValue.class); | |
Root root = q.from(Author.class); | |
q.select(cb.construct(AuthorValue.class, root.get(Author_.firstName), root.get(Author_.lastName))); | |
List authors = em.createQuery(q).getResultList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment