@Entity public class Person { @ElementCollection private List<Location> locations; [...] } @Embeddable public class Location { private Integer dummy; private Date creationDate; [...] }
Given the following structure, I would like to execute the HQL or CriteriaQuery equivalent of the following SQL:
SELECT l.* FROM Location l INNER JOIN Person p ON (p.id = l.person_id) WHERE p.id = ? AND l.creationDate > ?
I want to return a list of locations that are associated with this person and whose creation of dates after this.
Thanks in advance!
Mark
Edit ***: I edited SQL as it was something of a fallacy. I do not want to request seats independently.
nihilist84
source share