Hibernate 6.6.33.Final startup exception: “scale has no meaning for SQL floating point types”

After upgrading from Hibernate 5 to Hibernate 6.6.33.Final, when I run mvn install my build fails with the following exception:

Caused by: java.lang.IllegalArgumentException: scale has no meaning for SQL floating point types
at org.hibernate.dialect.Dialect$SizeStrategyImpl.resolveSize(Dialect.java:5449)
at org.hibernate.mapping.Column.calculateColumnSize(Column.java:468)
at org.hibernate.mapping.Column.getColumnSize(Column.java:440)

At first, I thought the issue was due to defining columns with precision/scale in my entities, e.g.:

@Column(precision = 10, scale = 3)
private Double xScale;

However, I have searched all entity classes in my project and don’t find any use of precision/scale annotations.

Has anyone else encountered this? What could be causing Hibernate to throw this exception during startup?

It’s very simple and the error already tells you. A binary floating point type like Double has no concept of “scale”, so you can’t specify it in the @Column annotation. If you want to map this double value to a decimal DDL type, then you have to annotate @JdbcTypeCode(SqlTypes.DECIMAL).

so I did not find the issue in @Column since I did not use any precision in the @Column, but later on I found out it was @Digits(integer = 10, fraction = 3, message = “Max of 3 decimal places”) causing the issue

Indeed, the @Digits annotation is being used to configure precision and scale automatically.