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.