Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I've a MS SQL database, (not a big one), when trying to do mapping my POCOs using this snippet

var configuration = Fluently.Configure()
          .Database(MsSqlConfiguration.MsSql2008.ConnectionString(x => x.Is(MetaResources.Properties.Settings.Default.erpConnectionString)))
          .ProxyFactoryFactory<NHibernate.ByteCode.Spring.ProxyFactoryFactory>()
          .Mappings(mappings => mappings.FluentMappings.AddFromAssemblyOf<RescueCars.Domain.Model.SysUser>())
          .BuildConfiguration();

I got this error

An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

The inner exception for this exception is

{"(XmlDocument)(3,6): XML validation error: The element 'composite-id' in namespace 'urn:nhibernate-mapping-2.2' has incomplete content. List of possible elements expected: 'meta, key-property, key-many-to-one' in namespace 'urn:nhibernate-mapping-2.2'."}

I reviewed my tables, and insure that: - Every table has a primary key - Every table has an Identity column (and it is the PK)

I know that it is not mandatory, but I think this information could help us find the problem.

I'm using C# 4.0, NHibernate 3.1.0.x, FLuent NHiberntae

as the error shows, the problem could be in one of the following:

meta, key-property, key-many-to-one

the last two, i think I understand them, but I don't know what kind of problems that could be existed in those. the first one 'meta' I don't understand what is it?

could anyone help me find where is the problem ??

share|improve this question
    
Do any of your fluent maps have the word Composite in them? – Mark Perry Jun 21 '11 at 14:48
    
OMG, sorry guys, I found the problem, there was a mapped class that doesn't have a table in the db :D sorry for that ... – Mustafa Magdy Jun 21 '11 at 14:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.