{"record":{"id":"1545e27bf433e085","repo":"hibernate/hibernate-orm","slug":"temporal-starting-and-ending-columns-must-use-the","errorCode":null,"errorMessage":"Temporal starting and ending columns must use the same JDBC mapping","messagePattern":"Temporal starting and ending columns must use the same JDBC mapping","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/TemporalMappingImpl.java","lineNumber":91,"sourceCode":"\t\t\tMappingModelCreationProcess creationProcess) {\n\t\tthis.tableName = tableName;\n\n\t\tfinal var creationContext = creationProcess.getCreationContext();\n\t\ttemporalTableStrategy =\n\t\t\t\tcreationContext.getSessionFactoryOptions()\n\t\t\t\t\t\t.getTemporalTableStrategy();\n\n\t\tfinal var startingColumn = bootMapping.getAuxiliaryColumn( ROW_START );\n\t\tfinal var endingColumn = bootMapping.getAuxiliaryColumn( ROW_END );\n\t\tfinal var startingValue = (BasicValue) startingColumn.getValue();\n\t\tfinal var endingValue = (BasicValue) endingColumn.getValue();\n\n\t\tfinal var startingResolution = startingValue.resolve();\n\t\tfinal var endingResolution = endingValue.resolve();\n\n\t\tjdbcMapping = startingResolution.getJdbcMapping();\n\t\tif ( jdbcMapping != endingResolution.getJdbcMapping() ) {\n\t\t\tthrow new IllegalStateException( \"Temporal starting and ending columns must use the same JDBC mapping\" );\n\t\t}\n\n\t\tstartingColumnMapping = startingColumnMapping( tableName, startingColumn, creationContext );\n\t\tendingColumnMapping = endingColumnMapping( tableName, endingColumn, creationContext );\n\n\t\tfinal var dialect = creationContext.getDialect();\n\t\tif ( creationContext.getSessionFactory()\n\t\t\t\t.getChangesetCoordinator()\n\t\t\t\t.useServerTimestamp( dialect ) ) {\n\t\t\tcurrentTimestampFunctionName = dialect.currentTimestamp();\n\t\t\tcurrentTimestampExpression =\n\t\t\t\t\tnew SelfRenderingSqlFragmentExpression( currentTimestampFunctionName, jdbcMapping );\n\t\t}\n\t\telse {\n\t\t\tcurrentTimestampFunctionName = null;\n\t\t\tcurrentTimestampExpression = null;\n\t\t}\n\t}","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/TemporalMappingImpl.java#L73-L109","documentation":"Error \"Temporal starting and ending columns must use the same JDBC mapping\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when the starting and ending columns of a temporal (validity) mapping use different JDBC type mappings.","commonSituations":"See trigger scenarios.","solutions":["Use the same @JdbcTypeCode/type mapping for both the start and end temporal columns of the range mapping."],"exampleFix":null,"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"}