-->
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: hbm2ddl problem using NativeHiLoGenerator
PostPosted: Thu Aug 11, 2005 12:50 pm 
Newbie

Joined: Wed Feb 23, 2005 2:08 pm
Posts: 17
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3

I get the following exception when trying to generate the schema. I created the schmea by hand and all of my unit tests pass when inserting/updating/removing etc. It looks like it has a problem with our impl of the hi/lo generator. Any suggestions. thanks

Scott

Full stack trace of any exception that occurs:11 Aug 2005 12:21:50,771 [INFO] Dialect.<init> - Using dialect: org.hibernate.dialect.Oracle9Dialect

11 Aug 2005 12:21:50,781 [INFO] Configuration.secondPassCompile - processing extends queue
11 Aug 2005 12:21:50,781 [INFO] Configuration.secondPassCompile - processing collection mappings
11 Aug 2005 12:21:50,781 [DEBUG] HbmBinder.doSecondPass - Second pass for collection: com.cl.entity.
action.vo.Action.productActions
11 Aug 2005 12:21:50,791 [INFO] HbmBinder.bindCollectionSecondPass - Mapping collection: com.cl.enti
ty.action.vo.Action.productActions -> product_action
11 Aug 2005 12:21:50,791 [DEBUG] HbmBinder.doSecondPass - Mapped collection key: oid, one-to-many: c
om.cl.entity.productaction.vo.ProductAction
11 Aug 2005 12:21:50,791 [DEBUG] HbmBinder.doSecondPass - Second pass for collection: com.cl.entity.
outcome.vo.Outcome.outcomeProducts
11 Aug 2005 12:21:50,791 [INFO] HbmBinder.bindCollectionSecondPass - Mapping collection: com.cl.enti
ty.outcome.vo.Outcome.outcomeProducts -> outcome_product
11 Aug 2005 12:21:50,791 [DEBUG] HbmBinder.doSecondPass - Mapped collection key: oid, one-to-many: c
om.cl.entity.outcomeproduct.vo.OutcomeProduct
11 Aug 2005 12:21:50,791 [INFO] Configuration.secondPassCompile - processing association property re
ferences
11 Aug 2005 12:21:50,791 [INFO] Configuration.secondPassCompile - processing foreign key constraints

11 Aug 2005 12:21:50,791 [DEBUG] Configuration.secondPassCompileForeignKeys - resolving reference to
class: com.cl.entity.outcome.vo.Outcome
11 Aug 2005 12:21:50,791 [DEBUG] Configuration.secondPassCompileForeignKeys - resolving reference to
class: com.cl.entity.outcome.vo.Outcome
11 Aug 2005 12:21:50,791 [DEBUG] Configuration.secondPassCompileForeignKeys - resolving reference to
class: com.cl.entity.product.vo.Product
11 Aug 2005 12:21:50,791 [DEBUG] Configuration.secondPassCompileForeignKeys - resolving reference to
class: com.cl.entity.action.vo.Action
11 Aug 2005 12:21:50,791 [DEBUG] Configuration.secondPassCompileForeignKeys - resolving reference to
class: com.cl.entity.action.vo.Action
11 Aug 2005 12:21:50,791 [DEBUG] Configuration.secondPassCompileForeignKeys - resolving reference to
class: com.cl.entity.product.vo.Product
11 Aug 2005 12:21:50,821 [ERROR] SchemaExport.main - Error creating schema
org.hibernate.MappingException: could not instantiate id generator
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:92)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:151)
at org.hibernate.cfg.Configuration.iterateGenerators(Configuration.java:548)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:644)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:49)
at org.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:378)
Caused by: org.hibernate.MappingException: could not interpret id generator strategy: com.cl.entity.
common.NativeHiLoGenerator
at org.hibernate.id.IdentifierGeneratorFactory.getIdentifierGeneratorClass(IdentifierGenerat
orFactory.java:103)
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:86)
... 6 more


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 13, 2005 5:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
did you put the id generator in the classpath ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: I got it working
PostPosted: Sat Aug 13, 2005 5:53 am 
Newbie

Joined: Wed Feb 23, 2005 2:08 pm
Posts: 17
thanks for the reply Max. A couple of simple gotchas to watch out for in my case.

Make sure the table is created :)
Make sure you implemented the sql String methods
public String[] sqlDropStrings(Dialect arg0) throws HibernateException {

log.error("sqlDropStrings called");
return new String[]{

"drop table " + tableName };

}

I had the generated stubbed out method which gave me a null pointer obviously :)

thanks again

Scott


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.