Enver oneToMany support

33 views
Skip to first unread message

Kun Li

unread,
May 5, 2020, 10:19:34 AM5/5/20
to nhusers
Hi guys,

Can I ask if the latest version of NHibernate.Enver support oneToMany associations?
What I want to do is like this.

Instance has many nodes.

//  Get historical state of entity instances
            var query = Session.Auditer().CreateQuery()
                .ForEntitiesAtRevision<Instance>(revisionId)
               .Add(AuditEntity.RelatedId("Template").Eq(id))
               .TraverseRelation("Nodes", JoinType.LeftOuterJoin);

Could somone shed some lights on me about this query?

Thanks in advance.

Roger

unread,
May 5, 2020, 10:57:20 AM5/5/20
to nhusers

I guess you mean if querying onetomany associations is possible? No, currently it is not, only “traverserelation” using inner join is possible.

Please report an issue on github.

 

(Depending on what you want to do and how your model look like, a possible workaround might be to query the child and “traverse” to the parent instead)

Reply all
Reply to author
Forward
0 new messages