Hello,
I'm trying to organize a bunch of date/time related properties in a component. Some of the properties are computed via the formula attribute. However, when I placed the dervied properties in a component, I received the following exception.
Code:
NHibernate.MappingException
property mapping has wrong number of columns: ClassName.MyNamespace.ClassName type: Time
nhibernate.dll!NHibernate.Mapping.PersistentClass.Validate(NHibernate.Engine.IMapping mapping)
nhibernate.dll!NHibernate.Mapping.RootClass.Validate(NHibernate.Engine.IMapping mapping)
nhibernate.dll!NHibernate.Cfg.Configuration.Validate()
nhibernate.dll!NHibernate.Cfg.Configuration.BuildSessionFactory()
Is the following syntax legal, or is this a genuine problem?
Code:
<component class="MyNamespace.Time, NHibernate.Test" name="HireTime" >
<property name="Date" column="hire_date" type="DateTime" />
<property name="Hour" formula="DATEPART(hh, hire_date)" insert="false" update="false" />
</component>