Hi James
Spotted it, in the one to many parts it just check if your using
the Iesi.Collections. types and if so sets the type appropriately.

Cheers

Andy


On Thu, Dec 11, 2008 at 10:55 AM, Andrew Stewart <
[EMAIL PROTECTED]> wrote:

> I was just thinking the same thing, I havent looked at the code yet, but
> I'm guessing that there's been a convention added to the convention class.
> Andy
>
>
> On Thu, Dec 11, 2008 at 10:27 AM, Chris <[EMAIL PROTECTED]> wrote:
>
>>
>> How does this patch work,  for example, with the code given below I
>> get 4 tables, A, B, AToB & BToA when I'd only expect the one xToy
>> Table, if I take the IList<A> out of class B ithen lose both xToy
>> tables and get an FK on the B table (as expected).  What am I doing
>> wrong here?
>>
>>
>> using System;
>> using System.Collections.Generic;
>> using System.Linq;
>> using System.Text;
>> using FluentNHibernate.AutoMap;
>> using Entities;
>> using NHibernate.Tool.hbm2ddl;
>> using NHibernate.Cfg;
>> using FluentNHibernate.Cfg;
>> using NHibernate;
>> using System.Collections;
>> using Iesi.Collections.Generic;
>>
>> namespace AutoMappingTest
>> {
>>    class Program
>>    {
>>        static void Main(string[] args)
>>        {
>>            Configuration cfg = new Configuration();
>>
>>            var config = MsSqlConfiguration.MsSql2005
>>                .ShowSql()
>>                .ConnectionString.Is("Data Source=.;Initial
>> Catalog=Testing;Integrated Security=True")
>>                .ConfigureProperties(cfg);
>>
>>            var model = new AutoPersistenceModel
>>            {
>>                Conventions =
>>                {
>>                    GetForeignKeyNameOfParent = type => type.Name +
>> "Id",
>>                    GetForeignKeyName = info => info.Name + "Id",
>>                    GetManyToManyTableName = ((child,parent)
>> =>child.Name + "To" + parent.Name)
>>                }
>>            };
>>
>>            model
>>                .AddEntityAssembly(typeof(A).Assembly)
>>                .Where(entity => entity.Namespace == "Entities")
>>                .Configure(config);
>>
>>            SchemaExport exporter = new SchemaExport(config);
>>            exporter.Execute(true, true, false, true);
>>        }
>>    }
>> }
>>
>> namespace Entities
>> {
>>    public class A
>>    {
>>        public virtual Guid Id { get; set; }
>>        public virtual string Name { get; set; }
>>        public virtual IList<B> Bees { get; set; }
>>    }
>>
>>    public class B
>>    {
>>        public virtual Guid Id { get; set; }
>>        public virtual string Name { get; set; }
>>        public virtual IList<A> Ays { get; set; }
>>     }
>> }
>>
>>
>> On Dec 11, 6:14 am, "Ayende Rahien" <[EMAIL PROTECTED]> wrote:
>> > This patch contains two new features regarding auto map.
>> > 1) it automatically detect if we should use <set> or <bag>
>> > 2) it now recognize <many-to-many> associations.
>> >
>> >  fluent_nh.patch
>> > 19KViewDownload
>> >>
>>
>
>
> --
> =================
> I-nnovate Software - Bespoke Software Development, uk wirral.
> http://www.i-nnovate.net
>



-- 
=================
I-nnovate Software - Bespoke Software Development, uk wirral.
http://www.i-nnovate.net

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to