Questions on EJB3 Persistence/Hibernate# Java - 爪哇娇娃
T*e
1 楼
I am using EJB3 Persistence through Hibernate. My entity classes are
annotated and packed in a jar file. It works.
I have two questions.
The first one is quite simple. Can I use simple classes (other than
entities) in EJB/QL? Example:
List addresses = entityManager.createNativeQuery(
"select u.address from user as u").listResults();
The above query seems fine. But how can I use the result? I've tried:
String address = (String) addresses.get(i);
but it doesnot' work.
The second questio
annotated and packed in a jar file. It works.
I have two questions.
The first one is quite simple. Can I use simple classes (other than
entities) in EJB/QL? Example:
List addresses = entityManager.createNativeQuery(
"select u.address from user as u").listResults();
The above query seems fine. But how can I use the result? I've tried:
String address = (String) addresses.get(i);
but it doesnot' work.
The second questio