Persist collection of interface using Hibernate

前端 未结 3 1993
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 05:44

I want to persist my litte zoo with Hibernate:

@Entity
@Table(name = \"zoo\") 
public class Zoo {
    @OneToMany
    private Set animals = new          


        
3条回答
  •  自闭症患者
    2020-12-01 05:54

    I can guess that what you want is mapping of inheritance tree. @Inheritance annotation is the way to go. I don't know if it will work with interfaces, but it will definitely work with abstract classes.

提交回复
热议问题