Skip to content
Advertisement

Query on parent’s collection – Hibernate Specification

I have three tables created with Hibernate. Product is the parent while barcodes is a collection end price is a child (one to many) of products.

JavaScript

I’m trying to query starting from the child (Price). I was able to query on a string but now i would like to query on the collection s element.

JavaScript

how would you write the specification? The one above is not working, i get this exception at runtime:

JavaScript

Thanks

Advertisement

Answer

Question solved by Thomas s comment.

For collections criteriaBuilder.isMember should be used.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement