-->
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.  [ 2 posts ] 
Author Message
 Post subject: Invalid DDL generated by Hibernate
PostPosted: Wed May 11, 2011 9:41 am 
Newbie

Joined: Mon May 09, 2011 11:50 am
Posts: 8
Hi,

When I am configuring Hibernate to "update" mode it is suppose to create new table along with constraints that are not existing in the database yet.

So, when I run the application it does executes DDL statements however they seems to be incorrect and Oracle throws an exception as follows:

Code:
DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table T_TEST_INFO (Id number(19,0) not null, IS_TRUE INT(1), TEST_NAME varchar2(255), IS_ATTEMPTED INT(1), IS_SKIPPED INT(1), OTHER_INFO varchar2(255), primary key (Id))
ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - ORA-00907: missing right parenthesis


What is wrong here?
Platform: Spring 3.0.5, Hibernate 3.2.6.ga, Java 1.5


Top
 Profile  
 
 Post subject: Re: Invalid DDL generated by Hibernate
PostPosted: Wed May 11, 2011 11:34 am 
Newbie

Joined: Mon May 09, 2011 11:50 am
Posts: 8
Issue Resolved!

For Oracle it is invalid to define a column type INT(1). Hence, I changed my hibernate definition to make it CHAR(1) as follows:

Code:
//before
@Column(name="IS_TEST_SKIPPED",columnDefinition="INT(1)")

//after
@Basic
@org.hibernate.annotations.Type(type="yes_no")
@Column(name="IS_TEST_SKIPPED")



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