java hibernate error reminder

Thanks dude.

org.hibernate.PropertyAccessException: could not get a field value by reflection getter of com.mypackage.MyEntity.entityId

There are reports that messages of this sort were due to bugs in one or more Hibernate releases. But this is also a legitimate error.

I wasted a lot of time before it hit me.


This is a sneaky one because when the database is laid out, you think in terms of foreign keys. But in ORM, you don’t see those keys directly - they translate to object references. So the original version was attempting to compare an object to the key of the object instead of an instance of the object.

No comments:

Post a Comment