Hi Oren

Glad you like the AutoMapping functionality, it's still rather early but it
certainly covers the basics at the moment. Thanks for your patch's they are
most appreciated. I've applied your patch now.
Andy

On Thu, Dec 11, 2008 at 5:57 PM, Ayende Rahien <aye...@ayende.com> wrote:

> Here is a patch to fix this issue.
>
>
> On Thu, Dec 11, 2008 at 6:13 PM, Ayende Rahien <aye...@ayende.com> wrote:
>
>> It doesn't :-(It needs a global view of things to make sense of that.
>> I'll publish a new patch, in which the conventional decision is to use the
>> master entity as the one being first in sort order.
>>
>> On Thu, Dec 11, 2008 at 5:27 AM, Chris <cmdrk...@googlemail.com> 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" <aye...@ayende.com> 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

--~--~---------~--~----~------------~-------~--~----~
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 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to