Hi,
I'm trying to find out if it's possible to query on a collection of value components with JPA.
Take the classic Invoice / Detail example mapped as follow :
Code:
@Entity
public class Invoice {
@org.hibernate.annotations.CollectionOfElements
private List<InvoiceLine> invoiceLines;
...
}
Code:
@Embeddable
public class InvoiceLine {
@org.hibernate.annotations.Parent
private Invoice invoice;
@ManyToOne
private Product product;
...
}
I want to query for all invoices that contain a certain product...
I know that the CollectionOfElements is not part of JPA but maybe Hibernate has a native solution for that kind of situation (which doesn't seem that exotic to me).
Any help would be appreciated...