{"record":{"id":"e0965627a2c4c2b1","repo":"hibernate/hibernate-orm","slug":"scale-has-no-meaning-for-sql-time-or-timestamp-typ","errorCode":null,"errorMessage":"scale has no meaning for SQL time or timestamp types","messagePattern":"scale has no meaning for SQL time or timestamp types","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java","lineNumber":6053,"sourceCode":"\t\t\t\t\t\tthrow new IllegalArgumentException(\"scale has no meaning for SQL floating point types\");\n\t\t\t\t\t}\n\t\t\t\t\t// but if the user explicitly specifies the precision, we need to convert it:\n\t\t\t\t\tif ( precision != null ) {\n\t\t\t\t\t\t// convert from base 10 (as specified in @Column) to base 2 (as specified by SQL)\n\t\t\t\t\t\t// using the magic of high school math: log_2(10^n) = n*log_2(10) = n*ln(10)/ln(2)\n\t\t\t\t\t\tprecision = (int) ceil( precision * LOG_BASE2OF10 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SqlTypes.TIME:\n\t\t\t\tcase SqlTypes.TIME_WITH_TIMEZONE:\n\t\t\t\tcase SqlTypes.TIME_UTC:\n\t\t\t\tcase SqlTypes.TIMESTAMP:\n\t\t\t\tcase SqlTypes.TIMESTAMP_WITH_TIMEZONE:\n\t\t\t\tcase SqlTypes.TIMESTAMP_UTC:\n\t\t\t\t\tlength = null;\n\t\t\t\t\tsize.setPrecision( javaType.getDefaultSqlPrecision( Dialect.this, jdbcType ) );\n\t\t\t\t\tif ( scale != null && scale != 0 ) {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"scale has no meaning for SQL time or timestamp types\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SqlTypes.NUMERIC:\n\t\t\t\tcase SqlTypes.DECIMAL:\n\t\t\t\tcase SqlTypes.INTERVAL_SECOND:\n\t\t\t\t\tsize.setPrecision( javaType.getDefaultSqlPrecision( Dialect.this, jdbcType ) );\n\t\t\t\t\tsize.setScale( javaType.getDefaultSqlScale( Dialect.this, jdbcType ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( precision != null ) {\n\t\t\t\tsize.setPrecision( precision );\n\t\t\t}\n\t\t\tif ( scale != null ) {\n\t\t\t\tsize.setScale( scale );\n\t\t\t}\n\t\t\tif ( length != null ) {\n\t\t\t\tsize.setLength( length );","sourceCodeStart":6035,"sourceCodeEnd":6071,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java#L6035-L6071","documentation":"Error \"scale has no meaning for SQL time or timestamp types\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: scale has no meaning for SQL time or timestamp types.","commonSituations":"Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: scale has no meaning for SQL time or timestamp types.","solutions":["Remove the scale attribute from the temporal column mapping.","Use precision instead of scale for temporal types."],"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"}