Tag Archives: Hibernate

Hibernate Associations: targetEntity

Hibernate provides quite a lot of power and features when it comes to mapping domain objects to relational tables. However, if used incorrectly, some of these nasty (in a good way, of course) little features could drive you crazy in a the rush of work.

One such powerful, but dangerous (if mis-used) feature of Hibernate associations is the support for specifying alternative types for mappings, instead of the type specified in the field itself. While this feature is quite useful in certain cases, mis-use of this could lead to hard to find bugs.

Continue reading