I'm sure I found a way around my problem, but I don't remember what it was, and I'm not working for that company any more so I don't have access to the code to go find out the answer, sorry :(
On Tue, Jan 21, 2014 at 8:18 AM, rj <[email protected]> wrote: > Seems this is still a problem. I too have the same issue now. Do you have > any workaround for this bug? > > > On Tuesday, February 22, 2011 12:08:34 PM UTC-6, Cheetah wrote: >> >> I have a domain model that contains some structures that in simplified >> form looks roughly like this: >> >> class Entity { >> int Id { get; set; } >> IDictionary<ControlledVocabulary,string> Metadata { get; set; } >> // ... >> } >> >> class ControlledVocabulary { >> int Id { get; set; } >> string Name { get; set; } >> //... >> } >> >> The Entity.Metadata property is mapped as a map using index-many-to- >> many. Under the hood, there are three tables here, one for Entity, >> one for ControlledVocabulary, and one for the Metadata collection. >> >> I can do HQL queries like this: "from Entity e join e.Metadata m where >> index(m) = :cv" to get all entities that have a value stored for a >> particular ControlledVocabulary item. >> >> However, what I need to do now is a left join constrained by the >> metadata, which I would think would be expressed thus: "from Entity e >> left join e.Metadata m with index(m) = :cv". However, when I do that, >> I get: >> >> NHibernate.Hql.Ast.ANTLR.InvalidWithClauseException: with-clause >> expressions did not reference from-clause element to which the with- >> clause was associated >> >> Is there a way to work around this, or a better way to model this kind >> of controlled vocabulary structure in the domain? The IDictionary/map >> model fits the business model exactly: each Entity is allowed to have >> zero or one values for each ControlledVocabulary item. >> >> Is this just plain a bug in the with clause handling? > > -- > You received this message because you are subscribed to a topic in the > Google Groups "nhusers" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nhusers/lPUbkMv2Q-s/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/nhusers. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/groups/opt_out.
