|
|
|
This is actually an issue when using any Dialect which reports that it supports "for update of columns", the Oracle dialects being examples of this.
Emmanuel could say more definitively, but I believe that @TableGenerator does not map to the enhanced table generator. I am still having the same problem with latest build 3.3.1. We are trying to implement TableGenerator for SQL Server and Oracle both. The configuration works well for SQL Server, but not for Oracle. Is this issue really fixed?
Exception in thread "main" org.hibernate.MappingException: could not instantiate id generator at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:98) at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:152) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:192) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) at managers.HibernateManager.createSessionFactory(HibernateManager.java:42) at hibernate.checkHibernate.<init>(checkHibernate.java:35) at hibernate.Main.startHibernate(Main.java:80) at hibernate.Main.main(Main.java:61) Caused by: java.lang.IllegalArgumentException: alias not found: tbl at org.hibernate.sql.ForUpdateFragment.<init>(ForUpdateFragment.java:36) at org.hibernate.dialect.Dialect.applyLocksToSql(Dialect.java:970) at org.hibernate.id.enhanced.TableGenerator.configure(TableGenerator.java:194) at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:94) ... 7 more Java Result: 1 @Prakash
Are you sure that you are using the 3.3.1 version of hibernate core? Your exception is the same as my was with 3.2.6 (before the fix). The exception says at org.hibernate.id.enhanced.TableGenerator.configure(TableGenerator.java:194) Checking the sourcecode of o.h.id.enhanced.TableGenerator this function name and row number is correct in 3.2.6 but it has changed in 3.3.1 (configure is between rows 279 - 299 now). Yes, I downloaded the distribution from http://sourceforge.net/project/showfiles.php?group_id=40712&package_id=127784&release_id=625684 and change log does mention 3.3.1.GA (2008.09.10)
May be the changes are not available in build available to download? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@GeneratedValue(strategy=GenerationType.TABLE)
@TableGenerator(name="mytable")