[fluent-nhib] Re: Obscure Mapping Error

2009-02-19 Thread Jimit
I've found why the error was occurring... doesn't seem to support nested classes even though NH does... This was mainly due the 'name' attribute of the 'class' element in the hbm mapping file being set to the class name. which isn't the complete class name for nested types. I fixed it by just sett

[fluent-nhib] Re: Obscure Mapping Error

2009-02-19 Thread Jimit
Additionally I'm now getting the following error: PersistenceTests.Can_Map_Orders_To_Database : Failed System.Xml.Schema.XmlSchemaValidationException: The element 'class' in namespace 'urn:nhibernate-mapping-2.2' has invalid child element 'set' in namespace 'urn:nhibernate-mapping-2.2'. List of

[fluent-nhib] Re: Obscure Mapping Error

2009-02-18 Thread Jimit
Glad to help. It seems not to have solved my problem though. A mapping file for DomainObject is still being generated. I think because ForTypesThatDeriveFrom (or IMappingOverride.Override) creates an AutoMap for DomainObject (which is meant to be used just for merging with AutoMaps of derived type

[fluent-nhib] Re: Obscure Mapping Error

2009-02-17 Thread Jimit
I've created a patch adding support for mapping entities in multiple assemblies. It basically follows the logic I suggested in the posts above. I've added a test verifying it works and as well as updated 3 tests that were failing as a result (I think) of a recent change in the mappings pushing col

[fluent-nhib] Re: Obscure Mapping Error

2009-02-17 Thread Jimit
The base classPersistenceModel already has a method AddEntityAssembly (Assembly assembly) seeming to suggest the semantics of working with multiple entity assemblies is already part of the API. I'd think it would simply be a matter of fitting the call into the fluent api for APMs, though there cou

[fluent-nhib] Re: Obscure Mapping Error

2009-02-17 Thread Jimit
Any word on support for mapping entities from multiple assemblies? I'd also appreciate feedback on the proposed solution above. On Feb 12, 11:40 pm, Jimit wrote: > Maybe we need a instance method on AutoPersistenceModel a la > IncludeEntitiesFromAssembly so we could say: > > var model = > AutoPe

[fluent-nhib] Re: Obscure Mapping Error

2009-02-12 Thread Jimit
Maybe we need a instance method on AutoPersistenceModel a la IncludeEntitiesFromAssembly so we could say: var model = AutoPersistenceModel.MapEntitiesFromAssembly.IncludeEntitiesFromAssembly (... and so on).Where(GetEntityFilter)... The first call to MapEntitiesFromAssembly would do essentially w

[fluent-nhib] Re: Obscure Mapping Error

2009-02-12 Thread James Gregory
MapEntitiesFromAssembly creates an instance of an AutoPersistenceModel, so you'd need to do something like this to use multiple assemblies: var autoMapper1 = AutoPersistenceModel.MapEntitiesFromAssembly(); var autoMapper2 = AutoPersistenceModel.MapEntitiesFromAssembly(); The problem is, that would

[fluent-nhib] Re: Obscure Mapping Error

2009-02-12 Thread Jimit
That unfortunately raises other issues for me - all my base classes including DomainObject are in another assembly (Core.Common) than the one that holds my domain model (Core.Domain). I don't suppose it's possible to call MapEntitiesFromAssembly more than once and filter it with the same predicate

[fluent-nhib] Re: Obscure Mapping Error

2009-02-12 Thread James Gregory
Yeah, that makes sense. Currently you shouldn't exclude something set with IsBaseType in your Where clause. That being said, the two should probably be equivalent really. On Thu, Feb 12, 2009 at 6:10 AM, Jimit wrote: > > I think I may have found the problem. DomainObject was excluded by my > ent

[fluent-nhib] Re: Obscure Mapping Error

2009-02-11 Thread Jimit
I think I may have found the problem. DomainObject was excluded by my entity filter in my call to Where on the AutoPersistenceModel (since it itself is not an entity, just a common base class for both entities and value objects and thus it doesn't have an Id, I figured no need). I subsequently did

[fluent-nhib] Re: Obscure Mapping Error

2009-02-10 Thread Jimit
This is my test fixture. I configure FNH in the Setup: [TestFixture] public class PersistenceTests { #region Setup/Teardown [SetUp] public void SetUp() { _sessionFactory = Fluently.Configure() .Database(SQLiteConfiguration.S

[fluent-nhib] Re: Obscure Mapping Error

2009-02-10 Thread James Gregory
Can we see how you're setting your conventions and where you're plumbing FNH into NHibernate? On Tue, Feb 10, 2009 at 12:01 PM, Jimit wrote: > > I get the following error when attempting to test my mappings: > > > lazy="true" assembly="Core.Common" namespace="Core.Common.Entities"> > xmlns="