Hibernate 继承映射

@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn()
public class Animal {

}

 

@Entity
@DiscriminatorValue(value= "P")
public class Pig extends Animal{

}

posted @ 2016-09-17 18:05  xinlinjun  阅读(136)  评论(0编辑  收藏  举报