Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Query within a BasicCollection

The MEMBER OF syntax may work for you : " select e from MyEntity e where 10 member of e.numbers"
--Gordon

Pierre-Olivier TERRISSE wrote:
Hello,

A begin with JPA Eclipse-Link and I need to query a database where an entity contains a BasicCollection.

@Entity
public class MyEntity {
   @BasicCollection(fetch=FetchType.EAGER)
   private List<Integer> numbers = new ArrayList<Integer>();
}

I want to query all entities that contain a certain value within the "numbers" attribute.

Query query = entityManager.createQuery("select e from MyEntity e where e.numbers=10");

This does not work. What is the correct syntax ?

Thanks in advance,

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top