Hibernate learning- ing File

Source: Internet
Author: User

1. xml statement

<Hibernate-mapping xmlns = "urn: nhibernate-mapping-2.2" namespace = "" assembly = "">

Namespace and assembly are required. Otherwise, the system will prompt that the ing file cannot be found.

Set mapping to 2.2 in the new version.

2. Use tinyint to store the bool type

In previous versions, you need to implement an iusertype class, which is no longer required in version 3.x. You can directly set it to tinyint in ing.

3. Attribute-related data dictionary without data update

Public Virtual area {Get; set;} // object class attribute, no data update

<Role-to-one name = "area" class = "area" column = "code" unique = "true" property-ref = "code" insert = "false" update = "false"/>

This configuration can be automatically associated with the region during reading, but this attribute is not involved in database storage operations.

 

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.