I would split the mappings into 3 dll's. I have your common mapping with
All the common mappings. Then have a Sql Server mapping dll and an Oracle
mapping dll which inherit the Common mapping and implements the db
specific Id strategy.
On Thursday, June 20, 2013, Felipe Oriani wrote:
> Hi guys,
>
> I have a application that will support SQL Server 2008, SQL Server 2012
> and Oracle. I have been using fluent nhibernate to map my entities with
> Nhibernate and I have some questions about how should I map the ID. Oracle
> supports only the Sequence, SQL Server 2008 only identity and Sql Server
> 2012 both. I would like to map in Sql Server (2008 and 2012) with Identity
> and Oracle with Sequence on the same code.
>
> How should I map the ID to work for all databases?
>
> It does not matter if I will have some IF's statement on my fluent mapping
> code. Looks my codes for mapping:
>
> For SQL:
>
> Id(x => x.Id).GeneratedBy.Native();
>
> For Oracle:
>
> Id(x => x.Id).GeneratedBy.Sequence("SQ_Customer");
>
> Thank you.
>
> ______________________________________
> Felipe B Oriani
> felipeoriani.com.br [email protected] <javascript:_e({}, 'cvml',
> '[email protected]');>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]<javascript:_e({},
> 'cvml',
> 'fluent-nhibernate%[email protected]');>.
> To post to this group, send email to
> [email protected]<javascript:_e({}, 'cvml',
> '[email protected]');>
> .
> Visit this group at http://groups.google.com/group/fluent-nhibernate.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
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.