{"record":{"id":"b3ddb4bccd07e4b7","repo":"hibernate/hibernate-orm","slug":"scale-has-no-meaning-for-sql-floating-point-types","errorCode":null,"errorMessage":"scale has no meaning for SQL floating point types","messagePattern":"scale has no meaning for SQL floating point types","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java","lineNumber":6035,"sourceCode":"\t\t\t\tcase SqlTypes.BINARY:\n\t\t\t\tcase SqlTypes.VARBINARY:\n\t\t\t\tcase SqlTypes.CLOB:\n\t\t\t\tcase SqlTypes.BLOB:\n\t\t\t\t\tsize.setLength( javaType.getDefaultSqlLength( Dialect.this, jdbcType ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase SqlTypes.LONGVARCHAR:\n\t\t\t\tcase SqlTypes.LONGNVARCHAR:\n\t\t\t\tcase SqlTypes.LONGVARBINARY:\n\t\t\t\t\tsize.setLength( javaType.getLongSqlLength() );\n\t\t\t\t\tbreak;\n\t\t\t\tcase SqlTypes.FLOAT:\n\t\t\t\tcase SqlTypes.DOUBLE:\n\t\t\t\tcase SqlTypes.REAL:\n\t\t\t\t\t// this is almost always the thing we use:\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 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\");","sourceCodeStart":6017,"sourceCodeEnd":6053,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java#L6017-L6053","documentation":"Error \"scale has no meaning for SQL floating point 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 floating point 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 floating point types.","solutions":["Remove the scale attribute from the column mapping.","Use a decimal/numeric type if scale is required."],"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"}