Hi,
I have Objects with an ObjectId class as an identifier. This is mapped to a long in the DB.
In the corresponding hibernate mapping I specified a PropertyAccesor in the <id> tag which does the conversion long to/from ObjectId
This works fine as long as I use Session.get() and load().
But when I create a Criteria, I get a ClassCastException when I add a Restrictions.eq("oid", myObject.getObjectId()) because Hibernate tries to assign a long. The PropertyAccessor is obviously not used in this case.
Have forgot something?
Regards, Markus
|