-->
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.  [ 5 posts ] 
Author Message
 Post subject: @Past Annotation Validation and Oracle
PostPosted: Mon Jun 06, 2005 12:21 am 
Beginner
Beginner

Joined: Mon Mar 28, 2005 12:58 pm
Posts: 27
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5 and annotations beta2

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I'm using the new validation annotations available in the annotations beta2 (thanks for that!!) and this is one problem I found (or I think I found):
Code:
    @Past
    public Date getBirthDate()
    {
        return birthDate;
    }


So, essentially this check works great in HSQLDB but I tested it on Oracle 8.1.7(using OracleDialect) it generates the following DDL:

Code:
create table Person (party_id number(19,0) not null, birth_date date check (birth_date < current_date), primary key (party_id))


The problem is that current_date was introduced only in Oracle 9i and was not available in Oracle 8.x. So it throws the following error:

Code:
ORA-02438: Column check constraint cannot reference other columns

I'm not sure what the solution is (I tried using sysdate through SQLPlus but that doesn't work either). To JIRA or not to JIRA. That is the question.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 12:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Add it to JIRA. At present the validation fwk is not aware of dialects, but in the long run it might make sense to change that...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 12:43 am 
Beginner
Beginner

Joined: Mon Mar 28, 2005 12:58 pm
Posts: 27
Done. http://opensource.atlassian.com/projects/hibernate/browse/HBX-277


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 14, 2007 12:47 pm 
Beginner
Beginner

Joined: Tue Nov 06, 2007 5:13 am
Posts: 28
note that current_date has well been added in oracle9, but it will still NOT work in a constraint (neighter will sysdate) - tested it with oracle10
see also: http://www.orafaq.com/forum/t/45046/0/

P.S. I did not dare to write this into the JIRA (http://opensource.atlassian.com/projects/hibernate/browse/HV-15?rc=1)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 14, 2007 1:07 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I dared for you :)

_________________
Emmanuel


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