Hi,
if anyone is interested ...
I implemented a solution mapping the collection with a where clause.
Thus, the collection will hold exactly one item.
>>>
...
<set name="Users" table="User" lazy="false" where="PRIMARY_USER=1"
fetch="join" cascade="all">
<key column="COMPANY_ID"/>
<one-to-many class="User"/>
</set>
..
<<<
The mapped class additionally provides a derived property which reads
this single element from the collection. The collection itself is
hidden from the client by the use of an interface the client uses.
If there's some other way I could do this, I would like to know ;)
kind regards,
Marc
On 25 Mai, 10:18, eilensm <[email protected]> wrote:
> Hello,
>
> following problem concerning the mapping of a 1-n collection.
>
> A company has 1..n users. One of these users is the primary user
> (marked by a boolean flag in the user table).
>
> How could I map these two tables to a company class that holds a
> collection of users and a direct reference to the primary user?
>
> Company
> - Users : IList<User>
> - PrimaryUser : User
> ...
>
> Any help is appreciated!
>
> Thanx in advance,
> Marc
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---