Newsletter |
Inheritance Mapping In Hibernate – Introduction
Hibernate » on Jun 20, 2011 { 25 Comments } By Sivateja
Compared to JDBC we have one main advantage in hibernate, which is hibernate inheritance.Β Suppose if we have base and derived classes, now if we save derived(sub) class object, base class object will also be stored into the database.
But the thing is we must specify in what table we need to save which object data ( i will explain about this point later, just remember as of now).
For Example:
class Payment { // content will goes here }
class CreditCard extends Payment { // content will goes here }
- See if you save CreditCard class object, then payment class object will also be saved into the database
Hibernate supports 3 types of Inheritance Mappings:
- Table per class hierarchy
- Table per sub-class hierarchy
- Table per concrete class hierarchy
Note: We can also called this Hibernate Inheritance Mapping as Hibernate Hierarchy
Will see these 3 Inheritance Mappings in depth___, friends ensure you are clear about all previous concepts so far we covered, if not so you may not understand further, please refer once if you have any doubts.
β ββ
You Might Also Like
::. About the Author .:: | ||
Comments
25 Responses to “Inheritance Mapping In Hibernate – Introduction”
Hi, Java4s
You have explained the tuffest topics in very very essiest way.
really i never find this kind of explanation on any website or in any book ever before.
Thank you so much.
RajKirpal
@Rajkirpal
Thanks much friend π
you are rock
Way of explanation its very good thank you
I really enjoyed..thanx alot to java4s..it is very useful and simple site..
Thanks Sivateja for the nice post.
Could you please post the mapping example using annotation.
Thanks..Very clean explanation.. Could you please tell me, which one is better to use out of three..
Thanks siva. could you please tell me, which is the better to use in that?
Good…site .Any one can understand easily.
bhai, bahut hi badiya likhte ho.
Keep it up Bro.
Thanks a lot Shiva……………..:). it is explained very easyest way and understandable.
Thank s anna
Whenever I go to understand any tough topic in java. I search the topic as Topic Name appended with java4s
good site
very good site to learn…keep posting π
I have learned hibernate from core to concepts….This site is very help full
Thanks…..
Thank you so much SivaTeja for this tutorial:)
Sir,
Awesome job helped a lot
Nice Explanation…
when i was read this tutorial,
it is all about the class room explanation by Shekar sir from Satya institute,Ameerpet,Hyderabad.
Thank you guys for the presentation of line to line from note book by shekar sir….
I must say, ur articles have really brushed up my topics dat any site or book couldn’t do….amazing!
BEST EXPLAINED…hats off to you bro…
Very good site to learnβ¦keep posting
Hi Java4s,
Really I am enjoying this explanation, it explains very nicely, never seen such kind of explanation any other site.
Please keep posting such kind of explanation it is really easy to understand.
I'm enjoying after reading this explanation.