Having the possibility to override "targetEntity" lets the user the
opportunity to change assosciations of sub classes without the need
of changing it's parent class.
Lets say we have the following classes:
- Customer (MappedSuperClass)
-- CustomerDE (Entity)
-- CustomerEN (Entity)
- Product (MappedSuperClass)
-- ProductDE (Entitiy)
-- ProductEN (Entitiy)
Note: All CustomerX entities use the same "customer" table and all
ProductX entities use the same "product" table. The only differ
by business logic.
CustomerDE->getFullName() --> "Herr Peter Mueller"
CustomerEN->getFullName() --> "Mr. P. Mueller"
Example for a sub class called "CustomerUK" (Enitity) which inherits
from "Customer" (MappedSuperClass). Because Customer has a many to many
association to Products, by default CustomerUK would have too. With this
patch this can be changed by applying the following to CustomerUK:
Special thanks so Danijel B.
Added test cases for [DDC-2042]