When to choose which strategy for inheritance mapping?
There are few rules for choosing inheritance strategy.
(1) If there is no need for polymorphic association and queries i.e if you use very rarely query for CreditCardHolder or you do not have any class that has association with CreditCardHolder class, That time you should use UNION based mapping ( Table per concrete class with union).
(2) If you requires a polymorphic association or queries and subclasses has few properties That time , you should use table per class hierarchy (using subclass element in mapping metadata file).
(3) If you requires a polymorphic association or queries and subclasses has many properties That time , you should use table per subclass (using join-subclass element in mapping metadata file) and if width and depth of inheritance hierarchy is high that time you should use Mixing inheritance strategy.
Interesting Article
ReplyDeleteSpring Hibernate Online Training | Hibernate Training in Chennai | Java Spring Hibernate Training Institutes in Chennai
Hibernate Online Training | Java Online Training | Java EE Online Training
Happy to found this blog. Good Post!. It was so good to read and useful to improve my knowledge as updated one, keep blogging. Hibernate Training in Electronic City
ReplyDeleteJava Training in Electronic City