hibernate/hibernate-orm · error · ModelsException
Could not resolve <jdbc-type-name>" + name +…
Error message
Could not resolve <jdbc-type-name>" + name + "</jdbc-type-name>
What it means
Resolving a <jdbc-type-name> from XML by reflecting a constant of org.hibernate.type.SqlTypes failed: the given name is not a field of SqlTypes. The faulty input is the jdbc-type-name text; it must match a SqlTypes constant such as VARCHAR or TIMESTAMP_WITH_TIMEZONE.
Solutions
- Use a registered JDBC type name (see JdbcType registration / standard SQL type codes) in the <jdbc-type-name> element.
Example fix
Use a registered JDBC type name (see JdbcType registration / standard SQL type codes) in the <jdbc-type-name> element.
Defensive patterns
Strategy: validation
When it happens
Trigger: An hbm.xml / orm.xml mapping document violates a mapping rule during bootstrap.
Common situations: Legacy XML mappings with invalid combinations (column+formula, mixed inheritance, missing identifiers, bad extends references).
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/1cb1c61ddbcda388.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/XmlAnnotationHelper.java:1191
else if ( jaxbBasicMapping.getJdbcTypeCode() != null ) {
applyJdbcTypeCode( jaxbBasicMapping.getJdbcTypeCode(), memberDetails, xmlDocumentContext );
}
else if ( isNotEmpty( jaxbBasicMapping.getJdbcTypeName() ) ) {
applyJdbcTypeCode(
resolveJdbcTypeName( jaxbBasicMapping.getJdbcTypeName() ),
memberDetails,
xmlDocumentContext
);
}
}
private static int resolveJdbcTypeName(String name) {
try {
final Field matchingField = SqlTypes.class.getDeclaredField( name );
return matchingField.getInt( null );
}
catch (NoSuchFieldException | IllegalAccessException e) {
throw new ModelsException( "Could not resolve <jdbc-type-name>" + name + "</jdbc-type-name>", e );
}
}
public static void applyJavaTypeDescriptor(
String descriptorClassName,
MutableMemberDetails memberDetails,
XmlDocumentContext xmlDocumentContext) {
final JavaTypeAnnotation typeAnn = (JavaTypeAnnotation) memberDetails.applyAnnotationUsage(
HibernateAnnotations.JAVA_TYPE,
xmlDocumentContext.getModelBuildingContext()
);
final ClassDetails descriptorClass = xmlDocumentContext
.getModelBuildingContext()
.getClassDetailsRegistry()
.resolveClassDetails( descriptorClassName );
typeAnn.value( descriptorClass.toJavaClass() );
}View on GitHub (pinned to fad1729dce)