Hi,
i use an Entity with a field "startTime". This field is of an own datatype
Time. To let Hibernet know how to handle with this field it is annotated with:
Code:
@Type(type = "de.abc.def.PersistentTime")
The Class
PersistentTime implements
org.hibernate.usertype.UserType and mapps between my own
Time and
java.sql.Date in the database.
This works great as long as i don't use named queries:
Code:
@NamedQueries({
@NamedQuery(name = "test.abc.query", query = "SELECT tab FROM Table tab"
+ "WHERE tab.startTime > :startTime") })
In this case JPA can not resolve the mapping and i get an exception:
Code:
java.lang.IllegalArgumentException: Parameter value [de.abc.def.time.Time@5c97bbb1] was not matching type [java.sql.Date]
Has anyone an idea how to get JPA able to map between my type and the database? Maybe there is a possibility to configure this mapping globaly?