NPE in Column.getSqlTypeCode(Mapping mapping) for column 'hib_sess_id' when using PersistentTableBulkIdStrategy

Description

We have a project using a dialect with PersistentTableBulkIdStrategy and containing an entity hierarchy with InheritanceType ‘Joined’, so a column ‘hib_sess_id’ will be created in PersistentTableBulkIdStrategy.augmentIdTableDefinition(…).
As one can see for this column only the sqlType is set, but not the value attribute.
With ticket the row
final int sqlTypeCode = column.getSqlTypeCode( metadata );
was inserted in class AbstractMultiTableBulkIdStrategyImpl. which leads to a NullPointerException because inside that method getValue().getType() is called in line 198 but the value is null for column ‘hib_sess_id’.
I looked at the dialects hibernate provides, and I thing this affects the following ones having PersistentTableBulkIdStrategy:
CUBRIDDialect
InterbaseDialect
FirebirdDialect
FrontbaseDialect
JDataStoreDialect
McKoiDialect
MimerSQLDialect
PointbaseDialect
ProgressDialect
RDMSOS2200Dialect

Environment

None

Activity

Show:
Sönke Reimer
January 14, 2021, 10:46 AM
Edited

The error already occures on instantiation of the EntityManagerFactory (SessionFactoryImpl)

Nathan Xu
January 14, 2021, 6:32 PM

I am the original community contributor to fix https://github.com/hibernate/hibernate-orm/pull/3498/files. Thanks for the bug reporting. I will take a look at it soon.

Nathan Xu
January 15, 2021, 4:49 AM

PR created at:

Fixed

Assignee

Nathan Xu

Reporter

Sönke Reimer

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure