I dont think <component> is going to work in my case becz i have static objects in memory that have the displayname value which will not be stored in db. i will store the value (i.e. id) only and i want to let to nhibernate to map between values and associated static objects.
On Thu, Sep 17, 2009 at 1:48 PM, Roger Kratz <[email protected]>wrote: > IUserType > > > > ( > > …or, maybe – depending on how value is held in base class,… > > <component> > > ) > > > > > > *From:* [email protected] [mailto:[email protected]] *On > Behalf Of *Shadi Marei > *Sent:* den 17 september 2009 11:28 > *To:* [email protected] > *Subject:* [nhusers] Mapping a class based enum implementation > > > > Any idea how to map this class in nhibernate using the value as a field in > the database > > public class UserVisibleTo : Enumeration > { > protected UserVisibleTo() : base() { } > > public UserVisibleTo(int value, string displayName) : base > (value, displayName) { } > > public static readonly UserVisibleTo School = new UserVisibleTo > (0, "School"); > public static readonly UserVisibleTo Classroom = new > UserVisibleTo(1, "Classroom"); > public static readonly UserVisibleTo RoomParents = new > UserVisibleTo(2, "Room Parents"); > public static readonly UserVisibleTo HeadRoomParent = new > UserVisibleTo(3, "Head Room Parent"); > public static readonly UserVisibleTo Private = new > UserVisibleTo(4, "Private"); > > } > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
