-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate, Mysql and DATE
PostPosted: Fri May 15, 2009 1:48 pm 
Newbie

Joined: Fri May 15, 2009 1:32 pm
Posts: 1
OK so I want to have an entity in database where I would store date and another where I would store TIME (no date). I'd also like to store date of birth

so what I've did is create java classes, using @javax.persistence annotations and such, all went well, I have my entities now in mysql.

The problem is, when I said I have an attribute DATE birth_date, mysql uses DATETIME for that attribute. So now when I save let's say 1986-02-02, mysql adds 00:00:00.

Is there any javax.persistence annotation where I could say what type should mysql store?

I also have a few problems with TIME (I want to just store hours and minutes, no seconds, years, days, months).
Which type should I choose for attribute "myTime"?

Thanks for your help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.