Not exactly,  as a workaround, I map the class representing the
"collected" element, ie the IDictionary<Element> once as an element,
and once as an entity, obviously the class are different, and when I
use the class as an entity I did not pass trought the dictionary. Bad
workaround but worked for me. I already investigate other options and
did not find any other solution, even talked with Fabio and he
confirmed the behavior, so I opened the issue. A case test for the
issue should be in the mainstream of the nhibernate-core, so you can
see the failing test in all its beauty. The code I pointed in the
question is the "offended" part, and what it states it's pretty
obvious.
I just guessing if it make sense trying to solve the issue or to
retain my fancy workaround as a good solution.
Regards,
Felix.

On Oct 24, 11:03 am, "Richard Brown \(gmail\)"
<[email protected]> wrote:
> Unless I'm misunderstanding, you're trying to map the same class twice?  I
> don't think that would be supported.
>
> You could try asking in nhusers for other opinions/suggestions.
>
> Cheers,
>     Richard
>
>
>
>
>
>
>
> -----Original Message-----
> From: FaticaLabs
> Sent: Friday, October 21, 2011 4:43 PM
> To: nhibernate-development
> Subject: [nhibernate-development] Regarding NH2903
>
> Some days ago I opened an issue about wrong behavior of
> Session.CreateFilter(..). The behavior happens only with collection of
> elements ( not entity )
> The reason is this:
> if (IsFilter())
> {
> // Handle collection-fiter compilation.
>
> IQueryableCollection persister =
> _sessionFactoryHelper.GetCollectionPersister(_collectionFilterRole);
> IType collectionElementType = persister.ElementType;
> if (!collectionElementType.IsEntityType)
> {
> throw new QueryException("collection of values in filter: this");
> }
>
> And a better explanation is that the filter is just a mangled query
> around the entity collected, if there is no entity, such a query can't
> be created. So in real life I used two mapping for the child, one as
> element that I use when I update and work with the root entity in
> memory ( this achieve better performance ) and one as entity that I
> use when I want to do fancy GUI stuff. The final question is, can I
> add a "shadow entity" to the current NH mapping, to temporary map the
> element as an entity, in order to have the CreateFilter working with
> elements too, or is such a strategy totally forbidden ?

Reply via email to