You can't eager load multiple <bag>. A <bag> allow duplication.
If you try to write the same query using HQL you will see a nice exception.

Try to think this: can you add the same object instance, multiple time, in a
list ?

If you want eager-load more than one collection you must use ISet.

2009/11/28 cws <[email protected]>

> Hi!
>
> I am looking for a explaination on resulttransformers. Especially
> DistinctRootEntityResultransformer.
>
> If you compare using this on a criteria with ISession that produces a
> cartesian product, and if you are using bags. The ResulttTansformer is
> responsible to remove any duplicate of the rootEntity,  But I can
> still get duplicates on collections due to the cartesian product.
> Am I right?
> But NH will see to that all duplicates will be the same reference with
> help of the first level cache.
>
> If you do the same thing with IStatelessSession the transformer will
> not be able to work at all because of the lack of the first level
> cache?
> So you have to do that by hand or the implement your own
> ResultTransformer. Then you maybe can implement such a transformer
> using hashcode to determine if a entity is equal to antoher or not to
> remove duplicates?
>
> I can't find any about this in the documention.
>
> --
>
> 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.
>
>
>


-- 
Fabio Maulo

--

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