Hi all,
I'm a heavy user of dates (without time). My problem is that from the beginning of my Java life I've used an extended DateTime class instead of JDK's Calendar and Date (in many cases these seemed too illogical to me, a lot of extra functions, but with a lot of coding for a simplest using). This worked very fine in plain Java, and in BMP too. Now I'm trying CMP's capabilities, and I see that it handles only JDK's Date classes (or Serializable classes, which doesn't allow effective finding methods).
Is there any Pattern or solution to handle this problem in CMP?
My first thoughts are...
1. create a java.sql.TimeStamp as an abstract field for CMP, but in the interfaces create setXXXDate(MyDateClass date), which implementation calls the bean's setXXXTimeStamp(TimeStamp t) method?
2. forget CMP and make it in BMP... (anyway as far as I know in EJB QL there isn't any Date handling methods yet, which makes this solution more favourable).
Thanks, Ivan
-
CMP and Dates (3 messages)
- Posted by: Ivan Nemeth
- Posted on: May 01 2005 15:16 EDT
Threaded Messages (3)
- hellow by anna ai on May 23 2005 22:04 EDT
- CMP and Dates by Roger Lee on May 26 2005 09:55 EDT
- CMP and Dates by Ivan Nemeth on June 01 2005 13:59 EDT
-
hellow[ Go to top ]
- Posted by: anna ai
- Posted on: May 23 2005 22:04 EDT
- in response to Ivan Nemeth
a -
CMP and Dates[ Go to top ]
- Posted by: Roger Lee
- Posted on: May 26 2005 09:55 EDT
- in response to Ivan Nemeth
I convert dates to "long" for use with CMP.
Number of milliseconds from 1970.
Works fine me and can be used in EJB QL. -
CMP and Dates[ Go to top ]
- Posted by: Ivan Nemeth
- Posted on: June 01 2005 13:59 EDT
- in response to Roger Lee
First thanks for your comment.
You mean you have a long field instead of any kind of Date field in the entity bean? How do your set/get methods look like?
Ivan