I have multiple databases in my SharpArchitecture project and followed the guide outlined here:
http://wiki.sharparchitecture.net/FAQ.ashx
Everything works fine, except for my entities with assigned ids. I get a "database already configured" when trying to startup the application. Through some digging I get:
"Identity type must be integral (int, long, uint, ulong)"
public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
{
instance.Column("Id");
instance.UnsavedValue("0");
instance.GeneratedBy.HiLo("1000");
}
This is thrown during the instance.GeneratedBy.HiLo("1000")
; This is odd as my mapping is to an assigned id, and a string. It seems to be ignoring my assigned id map:
[SessionFactory(DataGlobals.SecondDbFactoryKey)]
public class SecondDbEntityMap: IAutoMappingOverride<SecondDbEntity>
{
public void Override(AutoMapping<SecondDbEntity> mapping) {
mapping.Id(x => x.AssignedIdProperty).GeneratedBy.Assigned();
}
}
That mapping should work, right? I have a couple of assigned id entities in my first database and they're mapped in the same fashion (sans session factory attribute) and work fine. I can't seem to figure this out.