Mathieu
unread,Apr 27, 2011, 9:51:28 AM4/27/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SimpleJPA
Hi !
I'm curently trying to use Simple JPA ( wich is very good, thanks to
the developpers :D )
I'm having trouble while using the ( )... Here is my request :
Query query = em.createQuery("select s from Session s where s.customer
= :customer and ( s.status = :status1 or s.status = :status2 )");
query.setParameter("customer", "1");
query.setParameter("status1", "open");
query.setParameter("status2", "uploading");
But at the execution, I get this erro :
Testcase: testGetRoot(unitTest.SessionTest): Caused an ERROR
parameter is null for: status2 )
javax.persistence.PersistenceException: parameter is null for:
status2 )
at
com.spaceprogram.simplejpa.query.QueryImpl.getParamValueAsStringForAmazonQuery(QueryImpl.java:
405)
at
com.spaceprogram.simplejpa.query.QueryImpl.appendCondition(QueryImpl.java:
388)
at
com.spaceprogram.simplejpa.query.QueryImpl.toAmazonQuery(QueryImpl.java:
270)
at
com.spaceprogram.simplejpa.query.QueryImpl.toAmazonQuery(QueryImpl.java:
270)
at
com.spaceprogram.simplejpa.query.QueryImpl.createAmazonQuery(QueryImpl.java:
173)
at
com.spaceprogram.simplejpa.query.QueryImpl.getResultList(QueryImpl.java:
104)
at sage.mybi.session.SessionTest.testGetRoot(SessionTest.java:
34)
I tried with or without space between characters and ( ) but still
failed...
Can anyone help me please ?