Sharp Architecture ignoring my Formula mappings
-
30-10-2019 - |
Frage
I'm having a problem where Sharp Architecture will correctly map everything I have setup in my IAutoMappingOverride
classes, except for Formula
. These get simply ignored and thus I get SQL's invalid identifier
when trying to query the database.
// NUnit setup
public virtual void SetUp()
{
configuration = NHibernateSession.Init(
new SimpleSessionStorage(),
RepositoryTestsHelper.GetMappingAssemblies(),
new AutoPersistenceModelGenerator().Generate(),
null,
null,
null,
FluentConfigurer.TestConfigurer.Contracts);
new FluentConfigurer(configuration)
.ConfigureNHibernateValidator()
.ConfigureAuditListeners();
}
public AutoPersistenceModel Generate()
{
return AutoMap.AssemblyOf<Contrato>(new AutomappingConfiguration())
.Conventions.Setup(GetConventions())
.IgnoreBase<Entity>()
.IgnoreBase(typeof(EntityWithTypedId<>))
.UseOverridesFromAssemblyOf<EmployeeMap>();
}
// My override.
public class EmployeeMap : IAutoMappingOverride<Employee>
{
public void Override(AutoMapping<Employee> mapping)
{
// This works...
mapping.Id(x => x.Id, "ID_EMPLOYEE");
// This is ignored...
mapping.Map(x => x.Name).Formula("UPPER(LTRIM(RTRIM(FIRST_NAME || ' ' || LAST_NAME)))");
}
}
Any ideas?
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow