Hibernate: Found: float, expected: double precision

前端 未结 8 1434
清歌不尽
清歌不尽 2020-12-16 21:28

I have a problem with the mapping of Oracle Float double precision datatype to Java Double datatype. The hibernate schema validator seems to fail when the Java Double dataty

8条回答
  •  清酒与你
    2020-12-16 21:48

    After lots of research and tries i found the solution of it. For Grails domain we can fix this problem by adding the sqlType as "float" for validation mode.

    In Result.groovy

    class Result{
        Double discount
    
        static mapping = {
            discount column: "discount", sqlType: "float"
        }
    
        static constraints = {
            discount(nullable: true)
        }
    }
    

    So it will remove the error in validation mode.

提交回复
热议问题