Where is the many-to-any mapping there?

    Diego


On Tue, Oct 19, 2010 at 17:27, JH <[email protected]> wrote:

> Hello,
>    We've used the <many-to-any/> mapping (http://ayende.com/Blog/
> archive/2009/04/22/nhibernate-mapping-ltmany-to-anygt.aspx) in a
> couple locations in our codebase. Since updating to NHibernate 3.0.0
> Alpha 3 we are experiencing problems with a Linq to NHibernate query
> that used to work.
>
> It is as follows:
>
>        public IList<Note> GetBy(INoteContainer context) {
>            var session = NHibernateHelper.CurrentSession;
>            return (from note in session.Query<Note>()
>                                    where note.Context == context
>                            select note).ToList();
>        }
>
> The error message is "SqlNode's text did not reference expected number
> of columns"
>
> The relevant mappings are as follows:
>
> For the context class:
>    <bag name="Notes" table="Note" access="field.camelcase"
> inverse="true"  cascade="delete-orphan">
>      <key column="NoteContainerId" />
>      <one-to-many class="Note" />
>    </bag>
>
> For the Note class:
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
>                   assembly="PD.Insulation.Domain"
>                   namespace="PD.Insulation.Domain">
>  <class name="Note">
>    <id name="Id">
>      <generator class="guid" />
>    </id>
>    <any name="Context" access="field.camelcase" id-type="guid" meta-
> type="System.String">
>      <meta-value value="Job" class="MyDomain.Job, MyDomain" />
>      <column name="NoteContainerType" />
>      <column name="NoteContainerId" />
>    </any>
>    <property name="Content" access="field.camelcase" />
>  </class>
> </hibernate-mapping>
>
> Has anyone else experienced a problem such as this since upgrading?
>
> TIA,
> JH
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to