Mantis - Resin
Viewing Issue Advanced Details
1691 major always 04-16-07 10:35 04-16-07 12:27
westrupp  
westrupp  
high  
closed 3.1.0  
fixed  
none    
none 3.1.1  
0001691: Amber NP's using createNativeQuery
1) Query q = complianceEm.createNativeQuery("select * from Location l where
l.countryId =?", Location.class);
q.setParameter(1, new Integer(countryID));
List<Location> allLocations = q.getResultList();

Throws this error:
java.lang.NullPointerException
    at
com.caucho.amber.manager.QueryImpl.checkParameterIndex(QueryImpl.java:89
4)
    at
com.caucho.amber.manager.QueryImpl.setParameter(QueryImpl.java:595)
    at
-----------
2) Query q = complianceEm.createNativeQuery("select * from Location l where
l.countryId =3", Location.class);
List<Location> allLocations = q.getResultList();

Throws this error:
java.lang.NullPointerException
    at
com.caucho.amber.manager.AmberConnection.addEntity(AmberConnection.java:
1303)
    at
com.caucho.amber.manager.AmberConnection.load(AmberConnection.java:961)
    at
com.caucho.amber.manager.QueryImpl.getInternalNative(QueryImpl.java:807)
    at
com.caucho.amber.manager.QueryImpl.getResultList(QueryImpl.java:196)

Notes
(0001853)
westrupp   
04-16-07 12:27   
jpa/0y17, jpa/0y20