|
I am using EJB to develop a web application. I created a user registry, mapped him as an entity, and made a simple query on the entity or by user.
There is no problem with searching by name. Now I want to combine with other systems, get a list of user names from other systems, and use the form LIST to list
Show listuser.
I want to query in the registry all records where all usernames are contained in listuser. I want to use EJBSQL language to implement, but the experimental results are always unsuccessful
. Please help me analyze it.
@PersistenceContext
private EntityManager em;
public List find (List listuserid)
{
String connselect = "select OBJECT (o) from userinfo o where o.userID IN: userid";
Query query = em.createQuery (connselect);
query.setParameter ("userid", listuserid);
return query.getResultList ();
}
I found this usage in hibernate and setParameterlist method in hibernate, but I don't know why there isn't in EJB, as if I
Run to em.createQuery (connselect); and an error occurs. |
|