我有一个@Embeddable
像这样的休眠注释类
@Embeddable
public class DataWrapper {
private DataWrapperType wrapperType;
@ManyToOne
private DataFactorX xFactor;
@ManyToOne
private DataFactorY yFactor;
@ManyToOne
private DataFactorZ zFactor;
// Getters and Setters
}
它非常简单地用于另一个实体
@Entity
public class DataManager {
private DataWrapper dataWrapper;
public DataManager() {
this.dataWrapper = new DataWrapper();
}
}
但是当我后来DataManager
从 Hibernate 检索一个实例时,该dataWrapper
字段返回 null。
有什么解释吗?