I have project use EJB 3.0 and implement Toplink framework for model layer.
When using EJBQL to process data, I see it seems have some limitation:
- It cannot process datatime such as find a part of date such as day, month or year
- It cannot find datetime among from...to
- It cannot comparison datetime field
- It cannot map a class not entity to a customize native select query because I want to get List data from SELECT statement but when I query in case join 2 or more table and map the object output into a class but impossible
@PersistenceContext private EntityManager em;
em.createNativeQuery("SELECT a.usertype , b.username, b.userpass FROM tablea a, tableb b WHERE a.id = b.id,MyClass.class).getResultList
.....
class MyClass(){
String usertype;
String username;
String userpass;}
Could you help me any ideas?
Thank in advance!
between :fromDate and :toDate
in the query, or use> :fromDate
and< :toDate
, in theNamedQuery
. Where is the problem.=
sign instead@SqlResultSetMapping
. Refer to this.