Hi Giulio - thanks for your reply. Sorry for just seeing your response.

I fear I'm not familiar enough with NH to know why your answer is hateful
:-o, heh.

I'm actually using Fluent, so I'm going to post how I'd do such an element
mapping over there.

I have something like 20 lookup tables all defined this same way .. this
specific table has one more column with the comma-delimited string that I
need as an array.

 .. below is how it's mapped currently. (I have a plain text property mapped
to the plain text of the column, and a read-only property that simply does a
join to return an array)

I'm not sure what the implications of the element mapping above are, or if
it was understood that this column is on the same table as the entity that's
already being mapped. The element mapping seems pretty straightforward, but
then I thought having to specify the table on the Set and a keycolumn would
infer that when the TechSupportCloseCode entities are loaded, that 2 selects
will be executed per entry?

public class TechSupportCloseCodeMap : ClassMap<TechSupportCloseCode>
   {
       public const string TS_CLOSE_CODE = "TS_CLOSE_CODE";

       public static class Fields
       {
           public const string CNR_BUSINESS_AREA_IDS =
"CNR_BUSINESS_AREA_IDS";
       }

       public TechSupportCloseCodeMap()
       {
           base.Table(TS_CLOSE_CODE);

           this.DoLookupTypeMap();

           Map(x => x.CnrBusinessAreaIDsRaw, Fields.CNR_BUSINESS_AREA_IDS)
               .ReadOnly();
       }
   }

public static class ClassMapExtensions
   {
       public static void DoLookupTypeMap<T>(this ClassMap<T> map)
           where T : BaseLookupType
       {
           map.DoLookupTypeMap<T>(
               () => map.Id(x => x.ID, BaseLookupTypeMap.Fields.ID)
               );
       }
       public static void DoLookupTypeMap<T>(this ClassMap<T> map, Action
IdMapAction)
           where T : BaseLookupType
       {
           map.Cache.ReadOnly();

           IdMapAction();

           map.Map(x => x.Code, BaseLookupTypeMap.Fields.CODE);
       }

   }


------
Joe Brockhaus
[email protected]
------------


On Thu, Jun 16, 2011 at 10:50 AM, Giulio Petrucci <[email protected]
> wrote:

> Hi Joe,
>
> On Wed, Jun 15, 2011 at 4:33 PM, Joe B <[email protected]> wrote:
> > is this possible?
> [cut]
>
> I know that the answer I'm going to give is just hateful but... have
> you considered using <element>?
>
> <set name="..." table="...">
>    <key column="MyEntityId"/>
>    <element column="..." type="String"/>
> </set>
>
> HTH,
> Giulio
>
> --
>
> --
> 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.
>
>

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