|
Question : Problem in EJB QL Finder Method.....
|
|
Hi, I am developing an application based on EJB CMP2.0 Spec. I have a CMP BEAN with finder method as follows:- ================================================================= query ="SELECT Object(b) FROM CartMaster as b where b.customerid = ?1 and b.status='active' and b.cartdate = current_time()" =================================================================
I am using JBOSS4.0.3. But when I amdeploying bean over Server it gives me error like:- ==================================================================== 11:16:23,156 INFO [STDOUT] org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "CURRENT_TIMESTAMP" at line 1, column 102. Was expecting one of: > ... ... ====================================================================
What is wrong in above Query? How to correct it?
Please help me.
Thanx, Prash
|
Answer : Problem in EJB QL Finder Method.....
|
|
It looks like the data type used for the column cartdate is of type "DATETIME_VALUED_PARAMETER", and the function current_time() returns data of type "CURRENT_TIMESTAMP". You need to work out how to convert CURRENT_TIMESTAMP into DATETIME_VALUED_PARAMETER or call a function that returns a DATETIME_VALUED_PARAMETER instead of current_time().
|
|
|
|