ncthuc / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
0 stars 0 forks source link

ClassCastException on filter values #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Run a search with a filter on a property of type Long but use and Integer
for the value instead of a Long.

What is the expected output? What do you see instead?
The framework should automatically convert this, perhaps logging a warning.
If it cannot convert a type, it should throw a meaningful error.

Instead we're just getting an obscure ClassCastException in Hibernate when
it runs the query. This is hard to track down.

Original issue reported on code.google.com by dwolvert on 11 Aug 2008 at 5:15

GoogleCodeExporter commented 8 years ago
Problem solved. Now it tries to convert number types to the correct type and 
throws a
meaningful error if a type is incorrect and cannot be converted.

Original comment by dwolvert on 11 Aug 2008 at 7:35