Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] JPA Query + enum question

Is it possible to query for objects which have some kind of enum type?

For example :

@NamedQuery(name = "findRequestInStages", query = "select r from ImportRequest r where r.importStage in (:stages)")
//importStage is an Java 5 Enum.

getEntityManager().createNamedQuery("findRequestInStages").setParameter("stages", importStage is an Java 5 Enum.).getResultList();
//stages is an EnumSet.

I would like to get all the requests that have one of the given stages.

How can I do this?

Leon




Back to the top