0
나는 경계 상자 클래스를 가지고 있고, 나는 Fluent Nhibernate 클래스 속성에 매핑하거나 calculate 속성을 만드는 방법은 무엇입니까?
public class LocationBase : BaseEntity
{
public virtual int Id { get; set; }
public virtual double North { get; set; }
public virtual double East { get; set; }
public virtual double South { get; set; }
public virtual double West { get; set; }
public virtual string SpatialReferenceSystemCode { get; set; }
public LocationBase()
{
SpatialReferenceSystemCode = "EPSG:4236";
}
}
public class LocationGeographicPoint : LocationBase
{
public virtual double Longitude { get; set; }
public virtual double Latitude { get; set; }
}
public class LocationBaseMap : ClassMap<LocationBase>
{
public LocationBaseMap()
{
Table("Locations");
Id(x => x.Id).Column("LocationId").GeneratedBy.Increment();
Map(x => x.North).Not.Nullable();
Map(x => x.West).Not.Nullable();
Map(x => x.South).Not.Nullable();
Map(x => x.East).Not.Nullable();
Map(x => x.SpatialReferenceSystemCode).Default("EPSG:4326").Nullable();
}
}
public class LocationGeographicPoint : LocationBase
{
public virtual double Longitude { get; set; }
public virtual double Latitude { get; set; }
}
자신의 속성에 기반하여 경계 상자의 값을 설정 서브 클래스를 갖고 싶어
public class LocationGeographicPointMap : SubclassMap<LocationGeographicPoint>
{
public LocationGeographicPointMap() {
Map(x => x.Latitude).Not.Nullable();
Map(x => x.Longitude).Not.Nullable();
Map(x => x.SpatialReferenceSystemCode).Nullable();
Map(x => x.North).Function(m => m.Latitude);
Map(x => x.South).Function(m => m.Latitude);
Map(x => x.East).Function(m => m. Longitude);
Map(x => x.West).Function(m => m. Longitude);
}
이렇게 할 방법이 있습니까?