[fluent-nhib] How do you avoid selecting all tables with JoinedSubClass?

2009-03-01 Thread BringerOD
Here is my mappings. When I select a DomainEntity it tries to retrieve all data. All I want tis the DomainEntity. Any suggestions? public DomainEntityMap() { WithTable("DomainEntity"); Id(x => x.Id, "EntityID") .WithUnsavedValue(0)

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread James Gregory
It's not really a feature I'd like. The config file is the NHibernate config, it's got nothing to do with FNH and I think if we started parsing it, it adds another layer of complexity to the setup. On Sun, Mar 1, 2009 at 8:17 PM, epitka wrote: > > Could also fnh pick it up? > > On Mar 1, 2:02 pm

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread epitka
Could also fnh pick it up? On Mar 1, 2:02 pm, James Gregory wrote: > You shouldn't need to do the HbmMappings part, as that will be picked up > from your config. > > On Sun, Mar 1, 2009 at 7:55 PM, epitka wrote: > > > That is the thing, NHibernateHelper is external to my assembly and has > > no

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread James Gregory
You shouldn't need to do the HbmMappings part, as that will be picked up from your config. On Sun, Mar 1, 2009 at 7:55 PM, epitka wrote: > > That is the thing, NHibernateHelper is external to my assembly and has > no reference to it, so I cannot us as it does not know > where the mappings are.

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread epitka
That is the thing, NHibernateHelper is external to my assembly and has no reference to it, so I cannot us as it does not know where the mappings are. Currently in .config file I have attribute that tells it from what assembly to load mappings. It would be nice if fnh could read tab and check f

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread James Gregory
Yeah, that makes sense. Your exception tells me that you haven't added any fluent mappings. You should just be able to use the code from your first email combined with the second. var cfg = LoadDefaultConfiguration(); Fluently.Configure(cfg) .Mappings(m => m.AddFromAssemblyOf()) .BuildSes

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread epitka
I am trying to load regular nhibernate.config file that has connection, dialect, maping attribute and event listeners defined, and then use fluent to load mappings defined using fnh. Does that make sense? On Mar 1, 12:30 pm, James Gregory wrote: > I'm a little confused as to what you're trying t

[fluent-nhib] Re: Default Property set Implementation for use in ForAttribute

2009-03-01 Thread James Gregory
Attributes aren't really in our game plan. The ForAttribute thing is a nice shortcut, but it's not really something I want to promote. One of the big tenets of Fluent NHibernate is that it doesn't pollute your entities with mapping concerns; as a result, there aren't going to be any prebuilt attrib

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread James Gregory
I'm a little confused as to what you're trying to achieve. Can you explain your setup a little better? On Sun, Mar 1, 2009 at 5:44 PM, epitka wrote: > > Here is the full stack > > > [MappingException: An association from the table dnnSphere_Package > refers to an unmapped class: dnnSphere.Meta.M

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread epitka
Here is the full stack [MappingException: An association from the table dnnSphere_Package refers to an unmapped class: dnnSphere.Meta.Model.MetaProject] NHibernate.Cfg.Configuration.LogAndThrow(Exception exception) +107 NHibernate.Cfg.Configuration.SecondPassCompileForeignKeys(Table table,

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread epitka
Yes, I did and it works, but when I exclude one of the hbm files and include fluent class, it complains that that class has not been mapped: "An association from the table dnnSphere_Package refers to an unmapped class: dnnSphere.Meta.Model.MetaProject" where MetaProject is class mapped using Fluen

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread James Gregory
That should work. Have you tested your config without Fluent? On 3/1/09, epitka wrote: > > Ok I can do it like this > > Configuration cfg = LoadDefaultConfiguration(); > _sessionFactory = Fluently.Configure > (cfg).BuildSessionFactory(); > > but how do I add mapping assembly. A

[fluent-nhib] Re: how to load nhibernate.config

2009-03-01 Thread epitka
Ok I can do it like this Configuration cfg = LoadDefaultConfiguration(); _sessionFactory = Fluently.Configure (cfg).BuildSessionFactory(); but how do I add mapping assembly. Any ideas? nhibernate.config has mapping tag but is does not seem to work. On Mar 1, 8:38 am, epitka w

[fluent-nhib] Re: Map private property

2009-03-01 Thread epitka
Sorry, did not look at that one close enough. On Mar 1, 9:28 am, James Gregory wrote: > Did you read the wiki? How is yours any clearer than the Reveal example? > > On 3/1/09, epitka wrote: > > > > > I don't like any of these but this might work. What do you think? > > >   Map(x=>x.GetType().Ge

[fluent-nhib] Re: Map private property

2009-03-01 Thread James Gregory
Did you read the wiki? How is yours any clearer than the Reveal example? On 3/1/09, epitka wrote: > > I don't like any of these but this might work. What do you think? > > Map(x=>x.GetType().GetProperty("propertyName").Name); > or > > Map(x => x.GetType().GetProperties().Single > (p=>p.Name=

[fluent-nhib] how to load nhibernate.config

2009-03-01 Thread epitka
hi, Is there a way to load nhibernate.config directly through fluent? I have a common assembly that I use for all NH project that deals with sessions, config etc. Now I would like to be able to map entities using Fluent but configure using normal nhibernate.config. Why? Well for one in this line f

[fluent-nhib] Re: Map private property

2009-03-01 Thread epitka
I don't like any of these but this might work. What do you think? Map(x=>x.GetType().GetProperty("propertyName").Name); or Map(x => x.GetType().GetProperties().Single (p=>p.Name=="propertyName").Name); We would loose type safety but at least we don't have to do this additional stuff, and sp

[fluent-nhib] Default Property set Implementation for use in ForAttribute

2009-03-01 Thread Saintedlama
Hi, thank you for taking the effort to develop such a cool piece of code with an excellent fluent API! I'm using AutoPersistenceModel in a project. For most classes and properties the convention over configuration approach works fine but I'd need fine grained control over DB field length for a co