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