Created
November 7, 2013 06:07
-
-
Save tbuckel/7349789 to your computer and use it in GitHub Desktop.
JPA2 - Downcast
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
Root<Employee> empRoot = cq1.from(getEntityManagerFactory().getMetamodel().entity(Employee.class)); | |
Join<Employee, Project> join = empRoot.join("projects"); | |
Path exp = ((Path)join.as(LargeProject.class)).get("budget"); | |
cq1.where(qb1.equal(exp, new Integer(1000)) ); | |
// -------------- | |
Check for type: | |
cb.equal(join.type(), cb.literal(LargeProject.class)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment