hibernate/hibernate-orm · error · IdentifierGenerationException
Unknown integral data type for ids :
Error message
Unknown integral data type for ids :
What it means
Error "Unknown integral data type for ids : " thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/id/IdentifierGeneratorHelper.java:81
|| integralType == Long.TYPE ) {
return value;
}
else if ( integralType == Integer.class
|| integralType == Integer.TYPE ) {
return (int) value;
}
else if ( integralType == Short.class
|| integralType == Short.TYPE ) {
return (short) value;
}
else if ( integralType == BigInteger.class ) {
return BigInteger.valueOf( value );
}
else if ( integralType == BigDecimal.class ) {
return BigDecimal.valueOf( value );
}
else {
throw new IdentifierGenerationException(
"Unknown integral data type for ids : " + integralType.getName()
);
}
}
public static long extractLong(ResultSet resultSet, long defaultValue) throws SQLException {
final long value = resultSet.getLong( 1 );
return resultSet.wasNull() ? defaultValue : value;
}
public static void bindLong(PreparedStatement preparedStatement, int position, long value) throws SQLException {
CORE_LOGGER.tracef( "binding parameter [%s] - [%s]", position, value );
preparedStatement.setLong( position, value );
}
public static Object getForeignId(
String entityName, String propertyName, SharedSessionContractImplementor sessionImplementor, Object object) {
if ( sessionImplementor.isManaged( object ) ) {View on GitHub (pinned to fad1729dce)
Solutions
- Use a supported integral id type (short, int, long, or their wrappers/BigInteger) for the identifier.
When it happens
Trigger: Thrown when an identifier generator produces or is asked for a Java type it does not support.
Common situations: Typical situations: mapping a numeric id to an unsupported type; a UUID generator configured with a non-UUID return type.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/a047b583d627da84.
Report an issue: GitHub.