Hibernate Inheritance (2) The subclass attribute is generated in one of its own tables, and the parent class property of a table
<?XML version= "1.0"?><!DOCTYPE hibernate-mapping SYSTEM "Http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"><!--the data for the specific table inheriting subclass extension is saved in the subclass table, the inherited data is saved by the parent class table in the configuration implementation (if only the ER diagram is a one-to-one relationship) because the data of the subclass is saved in its own table, so it does not need to be associated with a single table inheritance discrimination column but by a primary key -<hibernate-mapping Package= "Bean"> <classname= "Person"Table= "T_person" > <IDname= "id"><Generatorclass= "Identity"/></ID> < Propertyname= "Name"/> < Propertyname= "Password"/> < Propertyname= "Birthday"/> <Joined-subclassname= "Student"> <Keycolumn= "id"/>//must specify which parent class is associated with < Propertyname= "ClassId"/> < Propertyname= "ClassName"/> < Propertyname= "Course"/> </Joined-subclass> </class> </hibernate-mapping>
Hibernate Inheritance (2) The subclass attribute is generated in one of its own tables, and the parent class property of a table