does anyone know if and how the solution for following question (which is written in the JPA API) can be written using the hibernate criteria API?
To be more specific I
As explained here what I wanted is not possible:
The limitations of using an ElementCollection instead of a OneToMany is that the target objects cannot be queried, persisted, merged independently of their parent object. They are strictly privately-owned (dependent) objects, the same as an Embedded mapping. There is no cascade option on an ElementCollection, the target objects are always persisted, merged, removed with their parent.
So, I used a OneToMany instead.