Hibernate Mapping File Basic Overview

Source: Internet
Author: User

The mapping file describes the relationship between the object and the database, one of the core files that hibernate runs, and the key to writing hibernate.

Mapping files is a matter of thinking from the perspective of Java objects

A basic mapping file

<?XML version= "1.0"?><!DOCTYPE hibernate-mapping Public "-//hibernate/hibernate mapping DTD 3.0//en" "http://hibernate.sourceforge.net/ Hibernate-mapping-3.0.dtd "><hibernate-mapping Package= "Org.zln.hibernate.domain">    <classname= "User"Table= "User">        <IDname= "id"column= "id">            <Generatorclass= "Native"/>        </ID>        < Propertyname= "Name"column= "Name"/>        < Propertyname= "Birthday"column= "Birthday"/>    </class></hibernate-mapping><!--Class represents a Java class Name:java class name, because the package property is already set, so you do not need permission to set the class name table: The corresponding database table name, the default and Java class name the same ID used to map the primary key Name:java class represents the primary key Property name Colum: Primary key column, default is the same as property name generator: Primary key generation Method property mapping properties and Normal fields -

Here's just a simple description of what a mapping file is.

Hibernate Mapping File Basic Overview

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.