{"record":{"id":"828afc6b190adda2","repo":"hibernate/hibernate-orm","slug":"temporal-precision-temporaltype-mismatch-reques","errorCode":null,"errorMessage":"Temporal precision (TemporalType) mismatch; requested precision = %s; explicit JavaType (%s) precision = %s","messagePattern":"Temporal precision \\(TemporalType\\) mismatch; requested precision = (.+?); explicit JavaType \\((.+?)\\) precision = (.+?)","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java","lineNumber":628,"sourceCode":"\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 );\n\t\tfinal var jdbcMapping = basicTypeRegistry.resolve( explicitTemporalJtd, jdbcType );\n\t\treturn new InferredBasicValueResolution<>(\n\t\t\t\tjdbcMapping,\n\t\t\t\texplicitTemporalJtd,\n\t\t\t\texplicitTemporalJtd,\n\t\t\t\tjdbcType,\n\t\t\t\tjdbcMapping,\n\t\t\t\tdetermineMutabilityPlan( explicitMutabilityPlanAccess, explicitTemporalJtd, typeConfiguration )","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java#L610-L646","documentation":"Error \"Temporal precision (TemporalType) mismatch; requested precision = %s; explicit JavaType (%s) precision = %s\" 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":["Align @Temporal(TemporalType...) with the precision of the explicitly configured JavaType, or remove one of the two specifications."],"exampleFix":"Align @Temporal(TemporalType...) with the precision of the explicitly configured JavaType, or remove one of the two specifications.","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"}