I have the following simple JPA object:
@Entity @Table( name = myentity_table ) public class MyEntity { private double a; private double b;
a and b can be set to Double.POSITIVE_INFINITY . When I try to save a double-set object up to + INF to a database (MySQL) using the standard object manager, I get an exception:
java.sql.SQLException: "Infinity" is not a valid numeric or approximate numeric value
As far as I know, MySQL may not support NaN / -INF / + INF numbers. Is there a way to save this object without writing HQL queries and translating + INF to null (or max double)? Ideally, I would like to do this through the object manager, as usual.
Thanks in advance.
source share