Eclipselink类提取器

时间:2016-04-18 18:02:32

标签: jpa eclipselink extractor

我有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吗? 提前谢谢!

0 个答案:

没有答案