-->
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: SchemaExportTask with OracleDialect error
PostPosted: Fri May 27, 2005 3:55 pm 
Newbie

Joined: Fri Apr 08, 2005 2:22 pm
Posts: 8
I did a search of the forums and couldn't find anyone else that asked this question, which I found unusual since I would think it would be a pretty common problem.

I am using net.sf.hibernate.tool.hbm2ddl.SchemaExportTask with ant in an attempt to generate DDL.

I have been playing around with this for a little while and I am able to generate DDL using the following Dialects:

MySQLDialect
DB2Dialect
SQLServerDialect

However, when I attempt to generate DDL off of OracleDialect I get the following error:

C:\Jdev\9.0.5.2Location of the build file\build.xml:159: Schema text failed: Dialect does not support identity key generation

I assume that this is because Oracle does not have auto incrementation. However, if this is what is causing the problem, what is a good work around?

The project that I am working on requires me to be able to run the SchemaExportTask on my mapping file using all 4 of the Dialects listed above, without modifications to the mapping file between running SchemeExportTask with the various Dialects. Is this possible?

If this is not possible, what changes do I need to make to my mapping document in order to make hbm2ddl function with Oracle that would then need to be undone to make it function with the other 3?

If you need more information in order to troubleshoot my problem I would be more than happy to provide it. Please let me know.

Thanks for any help you can provide!

Hibernate version:
Hibernate 2.0

Mapping documents:
<id name="id" type="long" unsaved-value="null">
<column name="sync_id" sql-type="integer" not-null="true" />
<generator class="identity" />
</id>

Log of the failed attempt:
Buildfile: build.xml

schema:
[schemaexport] 0 [main] INFO hibernate.cfg.Environment - Hibernate 2.1.1
[schemaexport]
[schemaexport] 50 [main] INFO hibernate.cfg.Environment - loaded properties
from resource hibernate.properties: {hibernate.connection.username=cmarkiewicz,
hibernate.connection.password=password, hibernate.cglib.use_reflection_optimizer
=true, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.conne
ction.url=jdbc:mysql://172.31.17.22:3306/ods_huber, hibernate.connection.driver_
class=com.mysql.jdbc.Driver}
[schemaexport]
[schemaexport] 110 [main] INFO hibernate.cfg.Environment - using CGLIB reflec
tion optimizer
[schemaexport]
[schemaexport] 331 [main] INFO hibernate.cfg.Configuration - Mapping file: C:
\Jdev\9.0.5.2\jdev\mywork\Salesforce_Datamart\salesforce_datamart_partnerAPI\cla
sses\sfdatamart_mapping.xml
[schemaexport]
[schemaexport] 2644 [main] INFO hibernate.cfg.Binder - Mapping class: com.ci.d
b.member.SyncTimes -> sync_times
[schemaexport]
[schemaexport] 3435 [main] INFO hibernate.cfg.Binder - Mapping class: com.ci.d
b.member.AccountBean -> account_sf
This pattern continues for every object in the mapping document, as is to be expected
[schemaexport] 6590 [main] INFO hibernate.cfg.Binder - Mapping class: com.ci.d
b.member.UserRoleBean -> userrole_sf
[schemaexport]
[schemaexport] 6620 [main] INFO hibernate.cfg.Binder - Mapping class: com.ci.d
b.member.UserTeamMemberBean -> userteammember_sf
[schemaexport]
[schemaexport] 6790 [main] INFO hibernate.dialect.Dialect - Using dialect: net
.sf.hibernate.dialect.OracleDialect
[schemaexport]
[schemaexport] 6820 [main] INFO hibernate.cfg.Configuration - processing one-t
o-many association mappings
[schemaexport]
[schemaexport] 6820 [main] INFO hibernate.cfg.Configuration - processing one-t
o-one association property references
[schemaexport]
[schemaexport] 6820 [main] INFO hibernate.cfg.Configuration - processing forei
gn key constraints
[schemaexport]
[schemaexport] 7140 [main] INFO hibernate.cfg.Configuration - processing one-t
o-many association mappings
[schemaexport]
[schemaexport] 7140 [main] INFO hibernate.cfg.Configuration - processing one-t
o-one association property references
[schemaexport]
[schemaexport] 7140 [main] INFO hibernate.cfg.Configuration - processing forei
gn key constraints
[schemaexport]

BUILD FAILED
C:\Jdev\9.0.5.2Location of the build file\build.xml:159: Schema text failed: Dialect does not support identity key generation


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 28, 2005 10:05 pm 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
change <generator class="identity" /> to <generator class="native" /> .
Quote:
native picks identity, sequence or hilo depending upon the capabilities of the underlying database.

see also http://www.hibernate.org/hib_docs/reference/en/html_single/#mapping-declaration-id-generator


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 2:42 pm 
Newbie

Joined: Fri Apr 08, 2005 2:22 pm
Posts: 8
Thank you


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.