File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes How to persiste a Date type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "How to persiste a Date type" Watch "How to persiste a Date type" New topic
Author

How to persiste a Date type

Natalia Lopez
Ranch Hand

Joined: Feb 17, 2005
Posts: 41
Hi!
I have an Interface where you can choose day, month and year and then I{d like to save that on my class account expiration date where expiration date is a Java.util.Date.
Anybody can send me and example. I don't know hoe to convert an string to a Date that can be persisted by hibernate
King Regards
Naty
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Have a look at java.text.DateFormat. Particularly its parse method.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i use this utility class: (means Enter String output Date)

in my code i define:

and in my hbm.xml:

hope this helps


java amateur
Natalia Lopez
Ranch Hand

Joined: Feb 17, 2005
Posts: 41
Yes It was great!
Regards
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to persiste a Date type
 
Similar Threads
SCEA certification expire date.
How to find out download date of assignment?
Bangalore, Sun 310 Prefix exam vouchers
setting a expiration date on a link
Got response from Prometric