Fix QueryLiteral assertion error in table based multi-table insert handling
This commit is contained in:
parent
4903b2f14d
commit
aeb78bc7d6
|
@ -255,7 +255,7 @@ public class TableBasedInsertHandler implements InsertHandler {
|
||||||
final Optimizer optimizer = ( (OptimizableGenerator) generator ).getOptimizer();
|
final Optimizer optimizer = ( (OptimizableGenerator) generator ).getOptimizer();
|
||||||
if ( optimizer != null && optimizer.getIncrementSize() > 1 ) {
|
if ( optimizer != null && optimizer.getIncrementSize() > 1 ) {
|
||||||
final TemporaryTableColumn rowNumberColumn = entityTable.getColumns()
|
final TemporaryTableColumn rowNumberColumn = entityTable.getColumns()
|
||||||
.get( entityTable.getColumns().size() - 1 );
|
.get( entityTable.getColumns().size() - ( sessionUidColumn == null ? 1 : 2 ) );
|
||||||
rowNumberType = (BasicType<?>) rowNumberColumn.getJdbcMapping();
|
rowNumberType = (BasicType<?>) rowNumberColumn.getJdbcMapping();
|
||||||
final ColumnReference columnReference = new ColumnReference(
|
final ColumnReference columnReference = new ColumnReference(
|
||||||
(String) null,
|
(String) null,
|
||||||
|
@ -293,7 +293,8 @@ public class TableBasedInsertHandler implements InsertHandler {
|
||||||
if ( rowNumberType != null ) {
|
if ( rowNumberType != null ) {
|
||||||
values.getExpressions().add(
|
values.getExpressions().add(
|
||||||
new QueryLiteral<>(
|
new QueryLiteral<>(
|
||||||
i + 1,
|
rowNumberType.getJavaTypeDescriptor()
|
||||||
|
.wrap( i + 1, sessionFactory.getWrapperOptions() ),
|
||||||
rowNumberType
|
rowNumberType
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue