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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate doesn't create date table
PostPosted: Fri Jan 22, 2010 5:42 am 
Newbie

Joined: Fri Jan 22, 2010 5:28 am
Posts: 3
Im using Spring + hibernate Mysql.

Everything works fine except when Im using Date type for a column. When date is in a domain class hibernate skip creating the table.
When I remove the date fields, restart the app, the table and the rest of columns are created.
But when I put them back i doesnt work.

Every other data type works fine. I got no exceptions or at least not in the server log.

Any one knows anything about it or had experienced the same problem?

Thanks


Top
 Profile  
 
 Post subject: Re: Hibernate doesn't create date table
PostPosted: Fri Jan 22, 2010 6:01 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
One possibility is that there is an issue with a column name using a reserved keyword, but it is impossible to say without an more information about your mapping documents/annotations or code.


Top
 Profile  
 
 Post subject: Re: Hibernate doesn't create date table
PostPosted: Fri Jan 22, 2010 6:09 am 
Newbie

Joined: Fri Jan 22, 2010 5:28 am
Posts: 3
Yep that was it, I used Date from, and Date to.
Thanks!


Top
 Profile  
 
 Post subject: Re: Hibernate doesn't create date table
PostPosted: Fri Jan 22, 2010 11:45 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Single quotes around the offending field can help avoid the error. Of course, a different name will help even more. :)

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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

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.