hibernate/hibernate-orm · error · MappingException

Could not determine JavaType nor JdbcType to use for BasicVa

Error message

Could not determine JavaType nor JdbcType to use for BasicValue: owner = <ownerName>; property = <propertyName>; table = <tableName>; column = <columnName>

What it means

Error "Could not determine JavaType nor JdbcType to use for BasicValue: owner = <ownerName>; property = <propertyName>; table = <tableName>; column = <columnName>" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java:199

			}
		}
		else {
			if ( explicitJdbcType != null ) {
				// we have an explicit STD, but no JTD - infer JTD
				// NOTE: yes, it's an odd case, but easy to implement here, so...
				final var recommendedJavaType =
						recommendedJavaType( explicitJdbcType, selectable, typeConfiguration );
				// TODO: check this type cast
				final var recommendedJtd = (JavaType<T>) recommendedJavaType;
				jdbcMapping = resolveSqlTypeIndicators(
						stdIndicators,
						basicTypeRegistry.resolve( recommendedJtd, explicitJdbcType ),
						recommendedJtd
				);
			}
			else {
				// we have neither a JTD nor STD
				throw new MappingException(
						"Could not determine JavaType nor JdbcType to use" +
								" for BasicValue: owner = " + ownerName +
								"; property = " + propertyName +
								"; table = " + table.getName() +
								"; column = " + selectable.getText()
				);
			}
		}

		if ( jdbcMapping == null ) {
			throw new MappingException(
					"Could not determine JavaType nor JdbcType to use" +
							" for " + ( (BasicValue) stdIndicators ).getResolvedJavaType() +
							"; table = " + table.getName() +
							"; column = " + selectable.getText()
			);
		}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Annotate the property with an explicit type (@JavaType/@JdbcType, @Type, or a JPA @Convert) so Hibernate knows how to map it.
  2. Check that the Java type is registered in the type registry; custom types must be contributed via a TypeContributor or @TypeDef.

Example fix

Annotate the property with an explicit type (@JavaType/@JdbcType, @Type, or a JPA @Convert) so Hibernate knows how to map it.

When it happens

Trigger: An entity mapping annotation or bootstrap configuration violates a Hibernate mapping rule.

Common situations: Annotation mapping mistakes: inverse-side @Id associations, @Column on @OneToOne, unmapped association targets, mismatched @EnumeratedValue/@Temporal usage, duplicate sequence generators.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/8f1d93303d565fee. Report an issue: GitHub.