I am trying to create a query using the JPA CriteriaBuilder.
I have set up my root and want to create a Left Fetch Join.
I have followed as per the entity Manager documentation
http://docs.jboss.org/hibernate/entitym ... from-fetchMy code looks like the following
Code:
final CriteriaBuilder builder = entityManager.getCriteriaBuilder();
final CriteriaQuery<Entity> criteria = builder.createQuery(Entity.class);
final Root<Entity> entity= criteria.from(Entityt.class);
final Join<Entity,Entity2> entities = entity.fetch(Entity_.moreEntities, JoinType.LEFT);
The problem I have is the entity.fetch doesn't return a Join object but a Fetch object.
The Fetch object you can't do a .get method on and I want to be able to so I can add a where clause on query a joined column.
The documentation says .fetch does pass back a Join object.
Is the documentation wrong or am I doing it wrong?