Hi there,

I have a hierarchy of classes and want to use NHibernate search with
it but I get a exception with a message like

    "Circular reference, Duplicate use of XXX in root entity YYY."

If I remove one of the IndexedEmbedded attribute then it works. The
thing is that there isn't a circular reference but it can be that both
DefaultBar and Bars refer to the same object.

I fixed it by configuring one of the attributes by specifying a Depth
argument (Depth=1). Seems that it does not matter which of duplicate
attrbiutes get this parameter.


============================
[Indexed]
class Foo
{
        [DocumentId]
        public virtual int Id { get; protected set; }

        [IndexedEmbedded]
        public virtual Doom DefaultBar { get; set; }

        [IndexedEmbedded]
        public virtual ICollection<Bar> Bars { get; set; }
}

class Bar
{
        [IndexedEmbedded]
        public virtual Doom Doom { get; set; }
}

class Doom
{
        [Field(Index.Tokenized, Store=Store.Yes)]
        public virtual string Text { get; set; }
}
============================


I think that this is a bug as I cannot have a circular reference at
all in this model.

-- 
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