My situation is close to this question. I use patrodyne/hisrc-hyperjaxb maven plugin to generate entity classes with JPA annotions from xsd schema along with krasa-jaxb-tools plugin, which add validation annotaions.
There are some elements with type="xs:double"
in my xsd scheme and after classes generation there are some Double
fields which annotated @Column
like this:
@Column(name = "SOURCE_RATIO", precision = 20, scale = 10)
public Double getSourceRatio() {
return sourceRatio;
}
Then I generate Spring Data repositories with cmeza20/spring-data-generator and use Spring Data REST dependency.
Besides of all, I want to auto-create my database scheme, so I put that property in my application.properties
file:
spring.jpa.hibernate.ddl-auto=create
And when I run my application I get "java.lang.IllegalArgumentException: scale has no meaning for floating point numbers". How can I configurate @Column
annotation to exclude precision and scale for Double
java type?
I think the plugin have no any options to configure this (maybe Mr.O'Sullivan, plugin developer, can comment on that). But maybe "binding.xjc" may help with this problem. I don't have much experience with setting up the bindings file, please help me.