hibernate/hibernate-orm · error · UnsupportedMappingException
Specifying SoftDelete#converter in conjunction with SoftDele
Error message
Specifying SoftDelete#converter in conjunction with SoftDeleteType.TIMESTAMP is not supported
What it means
Error "Specifying SoftDelete#converter in conjunction with SoftDeleteType.TIMESTAMP is not supported" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/internal/SoftDeleteHelper.java:65
final var softDeleteIndicatorColumn = createSoftDeleteIndicatorColumn(
softDeleteConfig,
createSoftDeleteIndicatorValue( softDeleteConfig, table, context ),
context
);
table.addColumn( softDeleteIndicatorColumn );
target.enableSoftDelete( softDeleteIndicatorColumn, softDeleteConfig.strategy() );
}
private static BasicValue createSoftDeleteIndicatorValue(
SoftDelete softDeleteConfig,
Table table,
MetadataBuildingContext context) {
final var softDeleteIndicatorValue = new BasicValue( context, table );
softDeleteIndicatorValue.makeSoftDelete( softDeleteConfig.strategy() );
if ( softDeleteConfig.strategy() == SoftDeleteType.TIMESTAMP ) {
if ( softDeleteConfig.converter() != SoftDelete.UnspecifiedConversion.class ) {
throw new UnsupportedMappingException(
"Specifying SoftDelete#converter in conjunction with SoftDeleteType.TIMESTAMP is not supported"
);
}
softDeleteIndicatorValue.setImplicitJavaTypeAccess( (typeConfiguration) -> Instant.class );
}
else {
final ConverterDescriptor<Boolean,?> converterDescriptor =
ConverterDescriptors.of( softDeleteConfig.converter() );
softDeleteIndicatorValue.setJpaAttributeConverterDescriptor( converterDescriptor );
softDeleteIndicatorValue.setImplicitJavaTypeAccess(
typeConfiguration -> converterDescriptor.getRelationalValueResolvedType()
);
}
return softDeleteIndicatorValue;
}
private static Column createSoftDeleteIndicatorColumn(View on GitHub (pinned to fad1729dce)
Solutions
- Remove SoftDelete#converter when using SoftDeleteType.TIMESTAMP, or use a different soft-delete strategy with a converter.
When it happens
Trigger: Two mutually exclusive annotations are placed on the same property or class.
Common situations: Combining annotations Hibernate treats as alternatives (e.g. @DynamicInsert with @SQLInsert, @MapKey with @MapKeyColumn), often after copy-pasting mappings or upgrading versions.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/488ce5ee6b099767.
Report an issue: GitHub.