-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problems with @Past validator
PostPosted: Thu Jan 10, 2008 5:30 am 
Newbie

Joined: Thu Jan 10, 2008 5:26 am
Posts: 2
Location: Stuttgart, Germany
Please see here: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=127321

Best Regards, Matthias


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 4:59 am 
Newbie

Joined: Thu Jan 10, 2008 5:26 am
Posts: 2
Location: Stuttgart, Germany
Here the posting from jboss.org:

I use Hibernate as JPA implementation with JBoss Seam. The underlying database is MS SQLSERVER 2000. Recently I added Hibernate Validation and used the builtin @Past validator. But since then, a few tables where no longer generated with hbm2ddl. Then I detected that all tables those tables used an @Past annotation on a field:

Code:
10:04:57,375 INFO  [SchemaExport] Running hbm2ddl schema export
10:04:57,375 INFO  [SchemaExport] exporting generated schema to database
10:04:57,437 ERROR [SchemaExport] Unsuccessful: create table Lizenz ([...], erwerbsDatum datetime not null check (erwerbsDatum < current_date), [...])
10:04:57,437 ERROR [SchemaExport] Falsche Syntax in der Naehe des current_date-Schluesselwortes. [<- means in English: 'wrong syntax near current_date keyword']
[...]
10:04:57,828 INFO  [SchemaExport] schema export complete


Is this a bug in Hibernate Validator or hbm2ddl? Probably in association with MS SQLSERVER?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 7:00 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It's a fairly fundamental limitation in Hibernate Core and how it is integrated with Hibernate Validator, basically we cannot use the dialects to use the appropriate db function for current date.
We think of fixing this for Hibernate 4.
In the mean time you canrewrite the PastValidator class and remove the DDL changes.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.