on 04-06-2006 3:43 PM
I need to query the cmp entity bean over a RANGE OF DATE. Currently, the column type "DATE" (java.sql.Date) doesnt allow me to do the query, error returned during ejb-ql statement validation (first param. and second param. are both java type java.sql.Date):
select object(b) from MyEntity b where b.MYDATE > ?1 and b.MYDATE > ?2
select object(b) from MyEntity b where b.MYDATE between ?1 and ?2
i also saw http://help.sap.com/saphelp_nw04s/helpdata/en/13/dbb2b66146934a9662918755038ea1/frameset.htm
"If a cmp-field represents a date type and will be involved in a QL query, its Java type must be java.util.Date.
Does it meant in order to query over a range of date, the table column type has to be "TIMESTAMP" and use java type java.util.Date? Or, is there any other option to get what i want?
Any help would be much appreciated.
create additional column of type LONG to represent date.
dateFormat is of type java.util.Date:
long newLongDate = dateFormat.getTime();
select object(b) from MyEntity b where b.MYLONGDATE > ?1 and b.MYLOGDATE <= ?2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.