Those errors about nhibernate entities and Hbm.xml

Source: Internet
Author: User
Tags xml attribute

NHibernate, an entity corresponding to a hbm.xml, just at the beginning, I think the entity is written well,Hbm.xml write well, the database table generated well, then the end of the matter is simple, the rest is just write logic code, but , let me not think, after the database table is generated, and then in the process of writing logic code, about hbm.xml and entity reported errors, let me really angry, disgusting, now I encountered some errors to share out, hoping to bring your work alert and convenient.


Error One:

Reason:

Timestamp is the key word;

field and Entity fields in the database do not match


Error Two:

Reason:

The entity name is inconsistent, and your hbm.xml map should be shortanswerquestionrecordentity and you may have written shortanswerquestionentity.


Error Three:

Reason: Double check your hbm.xml, this time your hbm.xml may have duplicate property


Error Four:

Cause: double-check hbm.xml and entities to see if hbm.xml corresponds to the field in the entity, and you may have less than one Hbm.xml attribute in your entity.


Error Five:

This error let me struggle for a long while, because just started to encounter this error, is generally hbm.xml properties of the build operation is not embedded resources, so the idea fixed in this, let me depressed half a day .....


Reason:

The build operation in the Hbm.xml property may not be an embedded resource at this time

Remember that entities should correspond to Hbm.xml, not XML


Summarize:

Although these are all minor mistakes, these small errors can also make you look for a long time, and these errors sometimes make you puzzled, and precisely because of these mistakes, let me know more about nhibernate. Next, there are some errors about hbm.xml and entities, and if you encounter them next time, you will be able to fill them in ...



Those errors about nhibernate entities and Hbm.xml

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.