I've got a situation such as this...
I've four different tables namely btech_ece, btech_cse, btech_it, btech_eee each one of these tables have a similar posts. Its exactly that the title differs and anything else is same. Their posts are:

  • Id
  • Year
  • Semister
  • Section
  • Period
  • SubjectCode
  • Date
  • Status

now i've four different tables under each division ece, cse, it and eee. btech_cse_1, bteh_cse_2, btech_cse_3, btech_cse_4, btech_ece_1, btech_ece_2 and so forth..
the posts of those tables are just like this:

  • Roll_Number
  • Id
  • Present

the id column above is really a foreign key in the tables btech_cse. My idea was when i'm able to make use of a nesting of hibernate's inheritance hierarchy. I will have a class named btech and all sorts of the classes btech_cse, btech_ece, btech_eee, btech_it may be its union-subclasses and that i might have another class that states btech_cse_num the industry became a member of subclass of the aforementioned union subclass and every class from the form btech_cse_1 might be again a union-subclass from the btech_cse_num class. Is really nesting permitted in hibernate?

How do you best exploit the hibernate's inheritance feature to match my situation.?

If feasibility may be the only concern, then It is best to consider the hibernate reference documentation. The chapter on "Inheritance Mapping" gives some helpful pointers, this really is from version 3.3 paperwork:

Hibernate doesn't support mixing subclass, became a member of-subclass and union-subclass mappings underneath the same root class element. You'll be able to mix together the table per hierarchy and table per subclass methods underneath the exactly the same class element, by mixing the subclass and join elements. You'll be able to define subclass, union-subclass, and became a member of-subclass mappings in separate mapping documents directly beneath hibernate-mapping. This enables you to definitely extend a category hierarchy with the addition of a brand new mapping file.