Description
I hope the @SecondaryTable in supperclass,example:
@MappedSuperclass
@SecondaryTable(name=".." ..)
public B extends A {
}
@MappedSuperclass
public C extends B {
}
@Entity
public D extends C {
}
@Entity
public C extends C {
}
but query("select o from C where .."), the join is correct.i correct:
openjpa-jdbc\src\main\java\org\apache\openjpa\jdbc\meta\FieldMappingInfo.java
/**
- Return the join from the field table to the owning class table.
*/
public ForeignKey getJoin(final FieldMapping field, Table table,
boolean adapt) {
// if we have no join columns defined, check class-level join
List cols = getColumns();
if (cols.isEmpty()) {
cols = field.getDefiningMapping().getMappingInfo().
getSecondaryTableJoinColumns(_tableName);
if (cols.isEmpty())Unknown macro: { for (ClassMapping scm = field.getDefiningMapping().getPCSuperclassMapping(); scm != null; scm = scm.getPCSuperclassMapping()) { cols = scm.getMappingInfo().getSecondaryTableJoinColumns(_tableName); if (!cols.isEmpty()) break; } }}