我正在使用一个带有hibernate 5.1.1的项目,我正在尝试从我在项目中使用的API中映射一些类(所以我不能用它们来表示)。
@Entity
public class Activity implements Runnable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@OneToOne(cascade=CascadeType.ALL, fetch=FetchType.EAGER, optional=false, orphanRemoval=true, targetEntity=AuthData.class)
private AuthData authData = null; //AuthData is from an external API, I know its source code, but i cant insert the annotations in it.