{"record":{"id":"e56463a4fe45b6e0","repo":"hibernate/hibernate-orm","slug":"explicit-javatype-explicitjavatype-defined-for","errorCode":null,"errorMessage":"Explicit JavaType [<explicitJavaType>] defined for temporal value must implement TemporalJavaType","messagePattern":"Explicit JavaType \\[<explicitJavaType>\\] defined for temporal value must implement TemporalJavaType","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java","lineNumber":620,"sourceCode":"\t\t\t\ttemporalJavaType,\n\t\t\t\ttemporalJavaType,\n\t\t\t\texplicitJdbcType,\n\t\t\t\tjdbcMapping,\n\t\t\t\ttemporalJavaType.getMutabilityPlan()\n\t\t);\n\t}\n\n\tprivate static <T> @Nonnull InferredBasicValueResolution<T, T> fromTemporalExplicitJavaType(\n\t\t\tBasicJavaType<?> explicitJavaType,\n\t\t\tJdbcType explicitJdbcType,\n\t\t\tFunction<TypeConfiguration, MutabilityPlan<?>> explicitMutabilityPlanAccess,\n\t\t\tJdbcTypeIndicators stdIndicators) {\n\t\tfinal var typeConfiguration = stdIndicators.getTypeConfiguration();\n\t\tfinal var basicTypeRegistry = typeConfiguration.getBasicTypeRegistry();\n\t\tfinal var requestedTemporalPrecision = stdIndicators.getTemporalPrecision();\n\n\t\tif ( !isTemporal( explicitJavaType ) ) {\n\t\t\tthrow new MappingException( \"Explicit JavaType [\" + explicitJavaType +\n\t\t\t\t\t\"] defined for temporal value must implement TemporalJavaType\" );\n\t\t}\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal var explicitTemporalJtd = (TemporalJavaType<T>) explicitJavaType;\n\t\tif ( requestedTemporalPrecision != null\n\t\t\t\t&& explicitTemporalJtd.getPrecision() != requestedTemporalPrecision ) {\n\t\t\tthrow new MappingException(\n\t\t\t\t\t\"Temporal precision (TemporalType) mismatch; requested precision = %s; explicit JavaType (%s) precision = %s\"\n\t\t\t\t\t\t\t.formatted( requestedTemporalPrecision, explicitTemporalJtd, explicitTemporalJtd.getPrecision() )\n\n\t\t\t);\n\t\t}\n\n\t\tfinal var jdbcType =\n\t\t\t\texplicitJdbcType != null\n\t\t\t\t\t\t? explicitJdbcType\n\t\t\t\t\t\t: explicitTemporalJtd.getRecommendedJdbcType( stdIndicators );","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java#L602-L638","documentation":"Error \"Explicit JavaType [<explicitJavaType>] defined for temporal value must implement TemporalJavaType\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An entity mapping annotation or bootstrap configuration violates a Hibernate mapping rule.","commonSituations":"Annotation mapping mistakes: inverse-side @Id associations, @Column on @OneToOne, unmapped association targets, mismatched @EnumeratedValue/@Temporal usage, duplicate sequence generators.","solutions":["Use a JavaType that implements TemporalJavaType (e.g. the built-in temporal types) for this temporal attribute, or drop the explicit @JavaType."],"exampleFix":"Use a JavaType that implements TemporalJavaType (e.g. the built-in temporal types) for this temporal attribute, or drop the explicit @JavaType.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}