Conventions are perfect when the schema's amenable (and of course one can always use a mixture of conventions and explicit if needed). The main issue that I've encountered with using conventions is (1) nullability and (2) string lengths - do you have any suggestions for handling these cleanly?
My comment about the sweetness of pvginkel's approach was specific to his/her situation [where tables and columns have completely different names from the C#], definitely not something I'd use as a standard technique. /Pete From: [email protected] [mailto:[email protected]] On Behalf Of Ricardo Peres Sent: 19 June 2013 10:54 To: [email protected] Subject: Re: [nhusers] Using 100 tables o more with NHibernate Well, you have two possible approaches: 1 - Generate mappings for all tables/entities; 2 - Apply conventions and skip the mappings. CodeSmith, NHibernate Mapping Generator, Visual NHibernate or NHibernate Designer will handle the first case. The second case is perfectly handled with conventions, with the advantage that you do not have hundreds of mapping files or classes to maintain, store in source control, etc. RP On Wednesday, June 19, 2013 10:38:09 AM UTC+1, Surya Pratap wrote: not sure if it will help but you can check the Mapping Generator at https://nmg.codeplex.com/ On 19-06-2013 14:32, Ricardo Peres wrote: > Conventions are what you need. If you have a "normal" model, > everything will work fine out of the box. You just have to tell the > conventional mapper which is the id generation strategy to use, and > off you go. > > RP > -- 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. -- 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.
