GeneratedIdColumnHbmTests#testNativeId test fails with dialect supporting both IDENTITY and sequences

Description

`GeneratedIdColumnHbmTests#testNativeId()` fails with an assertion error.

This is caused by
`entityBinding.getPrimaryTable().getPrimaryKey().getColumns().get( 0
).isIdentity()` returning 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()`, which 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 (the dialect is under construction, as does the PostgreSQLDialect.

The core of the problem is the test in bindIdentifierGenerator(line 1481), which assumes the IdentityGenerator is the only way to get a primary key identity column. PostgreSQL dialect (and FoundationDB SQL Layer) use a derivation of `org.hibernate.id.SequenceGenerator` to create their identity column IDs.

Environment

Hibernate master branch, PostgreSQL

Status

Assignee

Gail Badner

Reporter

Thomas Jones-Low

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure