【发布时间】:2015-07-21 06:28:26
【问题描述】:
您能否用简单的“人类”语言解释这些注释的含义。我不想要文档,我只想听到类似 tAttr 表通过主键 InstitID 与 tInstit 表连接,约束如下等。 SQL 语言就可以了 :) 我有点困惑。谢谢
我有这个映射类
@Entity
@DiscriminatorValue("Individual")
@SecondaryTable(schema = "dbo", name="tAttr", pkJoinColumns = {@PrimaryKeyJoinColumn(name = "InstitID")})
public class FaIndividual extends FaClient
它扩展了这个:
@Entity
public abstract class FaClient extends FaInstit
及以上扩展
@Entity
@Immutable
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorFormula(
"CASE "
+ "WHEN ((InstType = 0) AND (PropDeal = 0)) THEN 'Individual' "
+ "WHEN ((InstType = 0) AND (PropDeal = 1)) THEN 'Legal' "
+ "WHEN (InstType = 1) THEN 'Bank' "
+ "WHEN (InstType = 2) THEN 'Subdivision' "
+ "END"
)
@Table(schema = "dbo", name = "tInstit")
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
public abstract class FaInstit
【问题讨论】:
标签: hibernate jpa hibernate-annotations