This content has been marked as final.
Show 2 replies
-
1. Re: Passing array of enum to SELECT * WHERE clause
jefec May 23, 2007 3:30 AM (in response to tonylmai)I'm using this solution:
public void get() {
List types = new ArrayList();
types.add(PersonType.DIRECTOR);
types.add(PersonType.STUDENT);
Query query = entityManager.createQuery("FROM Person p WHERE p.type IN (:types)")
.setParameter("types", types);
query.getResultList();
}
, where Person type is enum defined as :
public static enum PersonType {
STUDENT,
DIRECTOR,
...
}
What version of EJB do you have? -
2. Re: Passing array of enum to SELECT * WHERE clause
tonylmai May 23, 2007 1:44 PM (in response to tonylmai)I am using EJB3 with JBoss 4.0.5GA.
You save my day jefec. Thanks.
And I thought this board was dead. ;)