Hibernate framework Study Notes 2: Detailed description of the configuration file, hibernate Study Notes

Source: Internet
Author: User

Hibernate framework Study Notes 2: Detailed description of the configuration file, hibernate Study Notes

Entity class:

package domain;public class Customer {        private Long cust_id;    private String cust_name;    private String cust_source;    private String cust_industry;    private String cust_level;    private String cust_linkman;    private String cust_phone;    private String cust_mobile;    public Long getCust_id() {        return cust_id;    }    public void setCust_id(Long cust_id) {        this.cust_id = cust_id;    }    public String getCust_name() {        return cust_name;    }    public void setCust_name(String cust_name) {        this.cust_name = cust_name;    }    public String getCust_source() {        return cust_source;    }    public void setCust_source(String cust_source) {        this.cust_source = cust_source;    }    public String getCust_industry() {        return cust_industry;    }    public void setCust_industry(String cust_industry) {        this.cust_industry = cust_industry;    }    public String getCust_level() {        return cust_level;    }    public void setCust_level(String cust_level) {        this.cust_level = cust_level;    }    public String getCust_linkman() {        return cust_linkman;    }    public void setCust_linkman(String cust_linkman) {        this.cust_linkman = cust_linkman;    }    public String getCust_phone() {        return cust_phone;    }    public void setCust_phone(String cust_phone) {        this.cust_phone = cust_phone;    }    public String getCust_mobile() {        return cust_mobile;    }    public void setCust_mobile(String cust_mobile) {        this.cust_mobile = cust_mobile;    }    @Override    public String toString() {        return "Customer [cust_id=" + cust_id + ", cust_name=" + cust_name + "]";    }}
View Code

 

 

ORM metadata configuration file:

<? Xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE hibernate-mapping PUBLIC "-// Hibernate/Hibernate Mapping DTD 3.0 // EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <! -- Configure the relationship between the table and object --> <! -- Package property: enter a package name. for all attributes of the element whose complete class name needs to be written, you can directly write the short answer class name. --> 

 

 

Core configuration file:

Hibernate. cfg. xml:

<? Xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE hibernate-configuration PUBLIC "-// Hibernate/Hibernate Configuration DTD 3.0 // EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> 

 

Related Article

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.