Hibernate Inheritance (2) The subclass attribute is generated in one of its own tables, and the parent class property of a table

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.