1

How can i join fetch an Entity and use it in the where clause.

 Fetch<Transaction,Customer> customer =transaction.fetch(Transaction_.customer,JoinType.LEFT);
 cq.where(cb.equal(customer.get(Customer_.name), "xxx"));

I get the following error: The method get(SingularAttribute) is undefined for the type Fetch

Is there any workaround for this?

alambrache
  • 108
  • 1
  • 9
  • maybe this can help you http://stackoverflow.com/questions/4511368/jpa-2-criteria-fetch-path-navigation – Deh Sep 15 '15 at 15:12
  • Thanks for the head's up. I saw that thread, i was hoping there would be a cleaner/better way then casting the fetch to a join. – alambrache Sep 16 '15 at 06:59

0 Answers0