Fabio Maulo pisze:
> ISet is not the Devil and have an entity with ISet does not mean have 
> a dependency with NH.
> Microsoft has understand the need of Set semantic only in .NET3.5 but 
> unfortunately he understand the importance of the interface ISet only 
> for .NET4.0.
>
> If you need the Set semantic without a reference to Iesi collection 
> you can use ICollection<T> mapped to a set.
>
> 2009/8/3 Bartosz Pierzchlewicz <[email protected] 
> <mailto:[email protected]>>
>
>
>     Fabio Maulo pisze:
>     > Your is only part of the story... now try to study de difference
>     > between the semantic of a Bag and the semantic of Set.
>     >
>     >
>     > 2009/7/31 Bartosz Pierzchlewicz <[email protected]
>     <mailto:[email protected]>
>     > <mailto:[email protected] <mailto:[email protected]>>>
>     >
>     >
>     >     A little supplement.
>     >
>     >     This is more generic problem and I hope you not to tell me
>     'it is by
>     >     design'.
>     >
>     >     When in DB you have Product P, which has two collections:
>     Categories
>     >     {C1} and Attributes {Att1, Att2, Att3}
>     >     and you try to read it from DB:
>     >
>     >     Repository<DbProduct>.FindFirst(
>     >                                  
>      DetachedCriteria.For<DbProduct>().
>     >                                    SetFetchMode("Categories",
>     >     FetchMode.Eager)).
>     >                                    SetFetchMode("Attributes",
>     >     FetchMode.Eager));
>     >
>     >     This is what you get:
>     >     P {Categories {C1,C1,C1} and Attributes {Att1, Att2, Att3}}
>     >     P {Categories {C1,C1,C1} and Attributes {Att1, Att2, Att3}}
>     >     P {Categories {C1,C1,C1} and Attributes {Att1, Att2, Att3}}
>     >
>     >     I understand P duplicates, and I know how to get rid them,
>     but what
>     >     about duplicates of C1 ?
>     >
>     >     Bartosz Pierzchlewicz
>     >     Ps. sorry for more questions than answers
>     >
>     >
>     >
>     >
>     > --
>     > Fabio Maulo
>     >
>     > >
>     I know the difference, but as I wrote in my first post I can't use
>     Sets.
>
>     You tell me that such behavior is intentional?
>
>     Ok, but it is quite confusing, because it makes some inconsistency in
>     domain model:
>     we persist one object, but when we try to read it from DB again,
>     we get
>     object which is not identical.
>
>     Any idea how to fix it in Castle ActiveRecord? Can I use IList
>     interface
>     but push it through Set?
>
>     Bartosz Pierzchlewicz
>
>
>
>
>
> -- 
> Fabio Maulo
>
> >
Thanks,
I just found the same solution.
In Castle Active Record we can use RelationType = RelationType.Set 
attribute and of course ICollection<T> as you wrote.

I couldn't use Sets because of serialization problem through web services.

Bartosz Pierzchlewicz


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