support @SecondaryTable in MappedSuperclass
-------------------------------------------

                 Key: OPENJPA-688
                 URL: https://issues.apache.org/jira/browse/OPENJPA-688
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.1.0
         Environment: oracle10g
            Reporter: wilesun
             Fix For: 1.1.1


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()) {
                                for (ClassMapping scm = 
field.getDefiningMapping().getPCSuperclassMapping(); 
                                                scm != null; 
                                                scm = 
scm.getPCSuperclassMapping()) {
                                        
                                        cols = 
scm.getMappingInfo().getSecondaryTableJoinColumns(_tableName);
                                        if (!cols.isEmpty())
                                                break;
                                }
                        }
                }





-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to