c# - NHibernate mapping error - invalid child element 'many-to-one' -


Using the delicious NHibernate with autonomy, I am trying to map the following domains:

  public class company: emodel {public virtual id id (get; set;) public virtual string Name {get; set;}} Public class account: emodel {public virtual id id (get; set;} public virtual string name {get; set;} public virtual company company {received; set;}}  < / Pre> 

Many accounts of a company Normally, I will get an account directly and then sometimes find the affiliate company, so there is no need to list the accounts on the company model.

Liquid NHibernate creates the following HBM:

Company

   & Lt; Generator class = "identity" /> & Lt; / Id & gt; & Lt; Property name = "name" type = "system string, mscoreib, version = 4.0.0.0, culture = neutral, public token = B77A5C 561934A90" & gt; & Lt; Column name = "name" /> & Lt; / Property & gt; & Lt; / Square & gt; & Lt; / Hibernate-mapping & gt;  

Account

  & lt; Hibernate-mapping xmlns = "vase: nhibernate-mapping-2.2" default-access = "asset" auto-import = "true" default-cascade = "none" default-lazy = "true" & gt; & Lt; Class xmlns = "blur: nibinet-mapping -2.2" name = "datamodel.account, datamodel, version = 1.0.0.0, culture = neutral, public keynote = zero" table = "` account` "& gt; & Lt; Id name = "id" type = "System.Int32, mscorlib, version = 4.0.0.0, culture = neutral, public token = b77a5c561934e089" & gt; & Lt; Column name = "id" /> & Lt; Generator class = "identity" /> & Lt; / Id & gt; & Lt; Property name = "name" type = "system string, mscoreib, version = 4.0.0.0, culture = neutral, public token = B77A5C 561934A90" & gt; & Lt; Column name = "name" /> & Lt; / Property & gt; & Lt; Many-to-one class = "datamodel.company, datamodel, version = 1.0.0.0, culture = neutral, public keynote = zero" name = "company" & gt; & Lt; Column name = "company_id" /> & Lt; / Many-to-one & gt; & Lt; / Square & gt; & Lt; / Hibernate-mapping & gt;  

And I am getting the following error:

Element 'class' in the namespace is the invalid child element of' variant ': nhibernate-mapping-2.2' Nhibernate-maping-2.2 'list of expected potential elements:' Meta, subsal, cache, synchronize, comment, tupliser, id, composite ID 'in Namespace:' Nhibernate-maping-2.2 ' 2.2 '.

Do I need to do this a valid mapping?

The problem is that classes with these domains are not being held. I had a repository class in the same assembly, which was trying to include the natural NHibernate apparently in the domain. This caused an error due to the mapping of this class effort (unfortunately the error message did not say how the problem occurred).

I place it at the where constraint namespace.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -