Hi,
I use Hibernate as JPA implementation for unit tests on a HSQDLB database. But I encounter problems running a query that has a where clause on a float property, it returns no results.
My query is as following :
Code:
select ev.element from ElementValue ev where ev.data = :data and ev.floatValue = :floatValue
I defined my column this way :
Code:
@javax.persistence.Column(name = "FLOAT_VALUE_", insertable = true, updatable = true)
public java.lang.Float getFloatValue()
{
return floatValue;
}
If I run this query on a MySQL database, it works perfect. Using Hibernate console, I could make my query work on HSQLDB but I had to set the query parameter floatValue as a double instead of a float. So I think there is a problem with the way float properties are mapped with HSQDLB.
I saw you can force the column type within the @Column annotation, but I don't want to do this because my entities have to be database independant. So is there a way to change the type mapping for HSQLDB at runtime, for example in a config file ?
Thanks in advance
Olivier