[hibernate-dev] GeneratedIdColumnHbmTests#testNativeId test fails with dialect supporting both IDENTITY and SEQUNCES

Thomas Jones-Low thomas.jones-low at foundationdb.com
Wed Mar 5 13:17:43 EST 2014


	I'm building a new dialect for the FoundationDB SQL layer. I've merged 
in the recent metamodel merge into my working branch and ran across this 
new failure.

	GeneratedIdColumnHbmTests#testNativeId() fails with an assertion error. 
This is caused by 
entityBinding.getPrimaryTable().getPrimaryKey().getColumns().get( 0 
).isIdentity() returns false, which is should return true.

	The only place the column.isIdentity() is set true is in 
org.hibernate.metamodel.internal.Binder#bindIdentifierGenerator(line 
1491). And this is based upon if the 
entityIdentifier.getIdentifierGenerator(), which in turn delegates to 
Dialect#getNativeIdentifierGeneratorClass(), returns an 
IdentityGenerator.class

	The problem here is that a dialect can support IDENTITY column, but not 
use (or return) IdentityGenerator from the getNativeIdentifierClass().

	FoundationdDB SQL layer supports both IDENTITY and sequences, as does 
the PostgreSQLDialect.

	Is this a bug in Binder? that the test should be better formed to set 
the identity column.

	Is this a new limitation on Dialects, in that they can no longer 
correctly support both IDENTITY and sequences?

	What is the correct way to fix this problem?


More information about the hibernate-dev mailing list