jpql « Collection « JPA Q&A





1. How to filter collection in JPA/JPQL?    stackoverflow.com

I have two entities:

@Entity
public class Customer  implements java.io.Serializable {
...
    @OneToMany(fetch=FetchType.EAGER, mappedBy="customer")
    private Set<CustomerOrder> customerOrders;
...


@Entity
public class CustomerOrder  implements java.io.Serializable {
....     ...

2. JPQL maxResults on collection objs    stackoverflow.com

I have the following situation: a class Event that has a collection of Participant objects, but the class Participant don't have any reference to event. So, I need to get the ...

3. hibernate unexpected end of subtree when dealing with collection of basics    stackoverflow.com

i have the following entity:

@Entity
public class AnalysisPolicy extends PersistentEntity{
    private Set nodeIds;

@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(
        name="analysis_policy_nodes",
       ...

4. How to get the first member of the related collection in JPQL    stackoverflow.com

I have Product table which has a related table Images with a relation 1:M.

Class Product {
  private Integer productId;
  private String productName;
  ....
  ....
  ....
  ...