我有两种实体类型:
- RunContainer 父实体类型
- 运行子实体类型
Run 有一个属性 Status,它的类型是 RunStatus,如下所示:
public enum RunStatus
{
Created,
Starting,
// ...
}
public class Run
{
public int ContainerId { get; private set; }
// ...
public RunStatus Status { get; private set; }
}
RunContainer 有一个计算属性 ActiveRunCount,如下所示:
public class RunContainer
{
public int Id { get; private set; }
// ...
public int ActiveRunCount { get; private set; }
}
在RunContainer.ActiveRunCount
属性的映射中,我使用公式规范,如下所示:
<property name="ActiveRunCount" formula="(select count(r.Id) from Run r where r.ContainerId = Id and r.Status = 1)"/>
我的问题是我通过它们各自的数值而不是适当的符号名称来引用公式中的 RunStatus 枚举值。谁能告诉我如何改用符号名称?
谢谢。