Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-688

support @SecondaryTable in MappedSuperclass

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.0
    • 1.3.0
    • kernel
    • None
    • oracle10g

    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; } }

        }

      Attachments

        Activity

          People

            Unassigned Unassigned
            wilesun wilesun
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: