See Fabio Maulo's post here 
http://fabiomaulo.blogspot.co.uk/2011/07/nhibernate-playing-with-mapping-by-code.html,
 
specifically the part on auxiliary database objects and see if it helps.

RP

On Tuesday, July 9, 2013 9:04:12 AM UTC+1, Haimon wrote:
>
> Really needs your help. anyone???
>
> On Monday, July 8, 2013 3:27:39 PM UTC+3, Haimon wrote:
>>
>> I have the following classes:
>>
>> public class Event{
>>     public virtual Guid Id { get; set; }
>>     public virtual string UserName { get; set; }
>>     public virtual EventId EventId { get; set; }}
>> public class EventId {
>>     public virtual Guid EventGuid {get; private set;}}
>>
>> I am using a fluent NHibernate automapping in order to map my classes and 
>> I override specific properties when needed.
>>
>> Class: Event is in s_typesToMap and class: EventId is in s_components.
>>
>> As a result I get the following table generated:
>>
>> create table "Event" (
>>    Id UNIQUEIDENTIFIER not null,
>>    UserName NVARCHAR(255) null,
>>    EventIdentifierEventGuid UNIQUEIDENTIFIER null,
>>    primary key (Id))
>>
>> I want to create an index on EventIdentifierEventGuid which is a property 
>> in Event component.
>>
>> I tried to do it as follows:
>>
>> .Override<Event>(obj => obj.Map(x => 
>> x.EventId.EventGuid).Index("EventId_index"))
>>
>> When I generate the ddl I get the following:
>>
>> create index EventId_index on "Event" (EventGuid)
>>
>> The expected result should be an index on EventIdentifierEventGuid 
>> instead of EventGuid
>>
>> How can I do it?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to