我有2个实体对象A和B. B扩展A,我在A上有@ClassExtractor
,从数据库行返回正确的类类型。但是,如果我想查询A,它会检查类提取器吗?
A.java
@Entity
@Table
@ClassExtractor(MyClassExtractor.class)
public class A implements Serializable{
...
}
B.java
@Entity
@Table
public class A extends B{
...
}
MyClassExtractor.java
public class MyClassExtractor extends ClassExtractor{
@SuppressWarnings("rawtypes")
@Override
public Class extractClassFromRow(Record record, Session session){
return B.class;
}
所以当我在A上查询时,它会转到类提取器并返回B吗? 提前谢谢!