-->
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: "ant eg" creates columns with 'bad names' in Oracl
PostPosted: Tue Dec 02, 2003 5:28 pm 
Newbie

Joined: Tue Dec 02, 2003 4:54 pm
Posts: 2
Location: New York
Hi,

I'm new to Hibernate. I just downloaded the 2.1rc1 package and followed the simple installation instructions. I updated hibernate.properties to use our Oracle 8i server and ran "ant eg".

The build failed with multiple errors like the following:
SEVERE: ORA-00907: missing right parenthesis

On examining the shcema created by the 'eg' script, I noticed that two columns in the AUCTIONUSER table were created with surrounding double quotes. In other words, the column name actually includes the double quotes as part of the name (e.g. '"password"', '"initial"').

Further examination showed that the User.htm.xml file in the eg hierarchy includes the 'column' attribute for both of these properties (and not for the others). In both cases, there is a back tick (`) within the double quotes (e.g. <property name="password" column="`password`"/>) which I'm guessing is what's being translated into the double quotes by the dialect.

If I remove the back tick or the column attribute alltogether from the User.htm.xml definition, then the eg build script fails earlier when creating the schema with the following error:

SEVERE: Unsuccessful: create table AuctionUser (id NUMBER(19,0) not null, userName VARCHAR2(255) not null, password VARCHAR2(255), email VARCHAR2(255), firstName VARCHAR2(255), initial CHAR(1), lastName VARCHAR2(255), primary key (id))
SEVERE: ORA-00904: invalid column name

Notice that the create table syntax is wrong with "primary key (id)" specified as a column.

Has anybody else seen this problem? Is it specific to rc1? Am I'm doing something wrong or completely overlooked something? I couldn't find reference information about the back tick in the xml file. Something about it makes the SQL work for creating the table, but results in the columns having bad names.

Any help will be appreciated. I will now try to run the example against HypersonicSQL, even though it won't help much if it works. All our work needs to run against the production Oracle server.

Thanks in advance for your help and ideas,

Ike


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 02, 2003 5:30 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Have you set the OracleDialect?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 02, 2003 6:04 pm 
Newbie

Joined: Tue Dec 02, 2003 4:54 pm
Posts: 2
Location: New York
I was using the Oracle9Dialect specified by default in the properties file (assuming it would be backward compatible). I switched it to the generic OracleDialect and it worked.

Thanks a lot for the quick response!

I think it would be helpful to new Oracle users (like me :) to include two lines in the hibernate.properties file. One for older Oracle and one for Oracle9i, making it clear that two different Dialects are available (and not compatible). I would generate a patch if I could.

Thanks again,

Ike


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 02, 2003 6:07 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Changed in CVS.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.