Hi -
I am using Hibernate 2.1.7 and Oracle 9 DB, and I have been stuck on this issue for a quite a while - *any* help would be appreciated! I've tried multiple ways to fix this problem, but so far no luck.
I am trying to use the sequence generator class, however, I continue to get the following error when I use the SchemaExport tool:
Code:
[java] Feb 7, 2005 8:58:26 AM net.sf.hibernate.tool.hbm2ddl.SchemaExport main
[java] SEVERE: Error creating schema
[java] net.sf.hibernate.MappingException: could not instantiate id generator
[java] at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:82)
[java] at net.sf.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:82)
[java] at net.sf.hibernate.cfg.Configuration.iterateGenerators(Configuration.java:434)
[java] at net.sf.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:493)
[java] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:58)
[java] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:48)
[java] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:303)
[java] Caused by: java.lang.ClassNotFoundException:
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Unknown Source)
[java] at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
[java] at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:76)
[java] ... 6 more
Here are my set of xDoclet tags for my java class:
Code:
/**
* @hibernate.id name="id" column="ADDRESS_ID"
* type="long"
* generator-class="native"
* @hibernate.generator-param name="sequence" value="my_seq"
* @return Returns the addressId.
*/
public long getAddressId() {
return addressId;
}
And here is my Hibernate Properties file:
Code:
hibernate.dialect net.sf.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username user
hibernate.connection.password pwd
hibernate.connection.url jdbc:oracle:thin:@xxxxx
Code:
It was working fine when I was using generator-class="uuid.string", and now when I switched to "sequence", I run into these errors... (I also get these errors when I use generator-class='native')
please help!