I see, thanks


On Monday, April 16, 2012 2:57:35 PM UTC+2, fknebels wrote:
>
> I don't think you are using Component correctly in this case.
>
> See this link here:
>
> http://ayende.com/blog/3937/nhibernate-mapping-component 
>
> The classic case for component in when 2 domain types live in the same 
> table.  
>
> It looks like what you want is a ManyToOne mapping 
>
> On Mon, Apr 16, 2012 at 8:06 AM, Luka <[email protected]> wrote:
>
>> Hi, I'm trying to map a component of type: FormFieldType to a property on 
>> type: FormField.
>>
>> I have two tables in db: FormField and FormFieldType.
>>
>> mapper.Class<FormField>(map=>map.Component<FormFieldType>(p=>p.FormFieldType,
>>  
>> cm=>
>>                                                                     {
>>                                                                         
>> cm.Property(x => x.FormFieldTypeName, m => 
>> m.Column("FORM_FIELD_TYPE_NAME"));
>>                                                                         
>> cm.Property(x => x.FieldType, m => m.Column("FIELD_TYPE"));
>>                                                                         
>> cm.Property(x => x.Regex, m => m.Column("REGEX"));
>>                                                                     }));
>>
>> When I try to query the FormField table it says that 
>> columns: FORM_FIELD_TYPE_NAME, FIELD_TYPE, REGEX
>>  does not exist.
>> It is because nhibernate thinks that they are part of FormField table. 
>> But they are in FormFieldType table.
>> How to correctly map this?
>> Please help.
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "nhusers" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/nhusers/-/h3rp-C44bTIJ.
>> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/-IGtnfoGkToJ.
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