TL;博士
以此处的“子类”示例为例
https://github.com/jagregory/fluent-nhibernate/wiki/Fluent-mapping。
我想有一个公式,ChildMap它使用的Name属性Parent
详细信息
我有一个继承层次结构(Product-> StockProduct, KitProduct, ListingProduct, VariationParentProduct),其中包含一个包含所有公共字段的 Inventory_Product 表,和Inventory_StockProduct/Inventory_KitProduct等包含子类的特定字段。我相信这被称为子类表映射。  
在我的基类上Product,我有一个名为ProductType.  
public abstract class Product
{
    public virtual Guid ProductID { get; set; }
    public abstract ProductType ProductType { get; }
    public virtual int AvailableQuantity { get; set; }
}
public class StockProduct : Product
{
    // Some other fields
    public override ProductType ProductType
    {
        get { return ProductType.Stock; }
    }
}
public class KitProduct : Product
{
    // Some other fields
    public override ProductType ProductType
    {
        get { return ProductType.Kit; }
    }
}
public class ListingProduct : Product
{
    // Some other fields
    public override ProductType ProductType
    {
        get { return ProductType.Listing; }
    }
}
public class VariationParentProduct : Product
{
    // Some other fields
    public override ProductType ProductType
    {
        get { return ProductType.VariationParent; }
    }
}
public enum ProductType
{
    Stock = 0,
    Kit = 1,
    Listing = 2,
    VariationParent = 3
}
和映射
public class ProductMap : ClassMap<Product>
{
   public ProductMap()
    {
        Table("Inventory_Products");
        Id(x => x.ProductID).GeneratedBy.Guid();
        Map(x => x.Sku);
        Map(x => x.ProductType).CustomType<ProductType>().Access.ReadOnly();
    }
}
public class StockProductMap : SubclassMap<StockProduct>
{
    public StockProductMap()
    {
        Table("Inventory_StockProducts");
        KeyColumn("ProductID");
        Map(x => x.AvailableQuantity).Formula("(CASE ProductType WHEN 0 THEN (1) ELSE NULL END)");
    }
}
public class KitProductMap : SubclassMap<KitProduct>
{
    public KitProductMap ()
    {
        Table("Inventory_KitProducts");
        KeyColumn("ProductID");
        Map(x => x.AvailableQuantity).Formula("(CASE ProductType WHEN 0 THEN (2) ELSE NULL END)");
    }
}
我需要以某种方式在StockProduct/上定义的公式中访问它KitProduct以执行不同的 SQL
我试过StockProduct
Map(x => x.AvailableQuantity).Formula("(CASE ProductType WHEN 0 THEN (1) ELSE NULL END)") 
和套件产品
Map(x => x.AvailableQuantity).Formula("(CASE ProductType WHEN 1 THEN (2) ELSE NULL END)") 
但是带有 [ |ProductType的表别名的nhibernate 前缀。] 而不是基础产品。所以它引用的列不存在KitProductStockProduct
this.父对象的公式中是否有等价物?