joshua wrote:
If you still want to retain compatibility with 'auto-increment' databases such as HSQLDB, SQLServer and MySQL, the "native" id generator is best. This also accepts the 'sequence' parameter if you want to name a specific ORACLE sequence. This is ignored when using a database that supports 'auto-increment' columns.
Code:
<generator class="native">
<param name="sequence">MY_SPECIAL_SEQUENCE</param>
</generator>
Hi Joshua, and others,
I've been searching around on the forum for solution to a similar problem, but this is the only related post I have found. I am hoping you can help me out.
I am attempting to use generator-class = sequence with Oracle 9 DB, and I continue to obtain errors:
Code:
[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)
I've tried various parameter settings, but I continue to get this error. Any guidance would be appreciated.
Thanks..!