This content has been marked as final.
Show 3 replies
-
1. Re: Seam Pros - Need your opinion...Date vs Long
goku2 Sep 13, 2007 12:07 PM (in response to indyjones)Use
@Basic @Temporal(TemporalType.TIMESTAMP) private Date someDate;
It will store the timestamp and you could use the date class. I think it can work with Calendar too.
If you want the time represented in milliseconds sine the Epoch(1/jan/1970) use the method .getTime() from the Date class.
In your .xhtml use<h:outputText value="#{someBean.someDate}"> <s:convertDateTime pattern="dd/MM/yyyy H:mm" /> </h:outputText>
to show the date.
Hope this helps -
2. Re: Seam Pros - Need your opinion...Date vs Long
matt.drees Sep 13, 2007 12:48 PM (in response to indyjones)I'm fine with storing dates in the database. But if I had to store longs, I'd look into using Dates in my java object and mapping it to the database using a custom type. I haven't tried it, but I'm pretty sure that'd work.
If you decide to stay with having two properties, mark the Date one @Transient, and it won't show up as a column. -
3. Re: Seam Pros - Need your opinion...Date vs Long
indyjones Sep 13, 2007 1:07 PM (in response to indyjones)Thanks for the info guys!!
This helps a ton...
Indy