I tried to use the unique constraint for a component, so that all of
the members of a component together make up a single unique
constraint.
public class SpaceLocationMap : ClassMapWithGenerator<SpaceLocation>
{
public SpaceLocationMap()
{
Id(x => x.Id);
References(x => x.AtLocation);
Component<SpaceCoordinate>(x => x.Coordinates, m =>
{
m.Map(x => x.x);
m.Map(x => x.y);
m.Map(x => x.z);
}).Unique();
}
}
But when I call this sequence to hook up the mapping files
var persistentModel = new PersistenceModel();
persistentModel.addMappingsFromAssembly(typeof
(GameNHibernateSession).Assembly);
Storage = storage;
_Source = new SessionSource(properties, persistentModel);
I get the following error:
TestCase 'StarCurrents.IntegrationTests.GameSetupTests.SetupGameTest'
failed: System.ApplicationException : Error while trying to build the
Mapping Document for
'StarCurrents.Domain.Reality.BaseObjects.SpaceLocation'
----> NHibernate.MappingException : (XmlDocument)(7,63): XML
validation error: The 'unique' attribute is not declared.
----> System.Xml.Schema.XmlSchemaValidationException : The 'unique'
attribute is not declared.
C:\Users\Mark\Documents\Visual Studio 2008\Projects\fluent-nhibernate
\src\FluentNHibernate\Mapping\ClassMap.cs(168,0): at
FluentNHibernate.Mapping.ClassMap`1.ApplyMappings(IMappingVisitor
visitor)
..etc
Is this a bug, or am I doing something wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---