OpenJPA
  1. OpenJPA
  2. OPENJPA-227

Schema attribute for @Table() causes MappingToll validate to throw an exception

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP SP2 all current patches applied.
      Run through eclipse "external tools"
      Database MySQL ver 5.0.24a.
      MySQL JDBC Drive 5.04
      JDK 1.6.0_01

      Description

      This exception occurs by adding the schema attribute to the @table annotation and then running validate on a table-per-class inheritance strategy.

      @table(name="tableName") <- runs without exception
      @table(name="tableName", schema"schemaName") <- causes below exception

      Exception in thread "main" <4|true|0.9.6-incubating> org.apache.openjpa.util.MetaDataException: Errors encountered while resolving metadata. See nested exceptions for details.
      at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:501)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:283)
      at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:271)
      at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:660)
      at org.apache.openjpa.jdbc.meta.MappingTool.validate(MappingTool.java:718)
      at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:634)
      at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1059)
      at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:966)
      at org.apache.openjpa.jdbc.meta.MappingTool.main(MappingTool.java:907)
      Caused by: <4|true|0.9.6-incubating> org.apache.openjpa.util.MetaDataException: Table "bidspec.country" given for "ca.BidSpec.emall.categories.Country" does not exist.
      at org.apache.openjpa.jdbc.meta.MappingInfo.createTable(MappingInfo.java:453)
      at org.apache.openjpa.jdbc.meta.ClassMappingInfo.getTable(ClassMappingInfo.java:201)
      at org.apache.openjpa.jdbc.meta.strats.FullClassStrategy.map(FullClassStrategy.java:68)
      at org.apache.openjpa.jdbc.meta.ClassMapping.setStrategy(ClassMapping.java:343)
      at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:52)
      at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:305)
      at org.apache.openjpa.meta.MetaDataRepository.preMapping(MetaDataRepository.java:600)
      at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:487)
      ... 8 more
      NestedThrowables:
      <4|true|0.9.6-incubating> org.apache.openjpa.util.MetaDataException: Table "bidspec.country" given for "ca.BidSpec.emall.categories.Country" does not exist.
      at org.apache.openjpa.jdbc.meta.MappingInfo.createTable(MappingInfo.java:453)
      at org.apache.openjpa.jdbc.meta.ClassMappingInfo.getTable(ClassMappingInfo.java:201)
      at org.apache.openjpa.jdbc.meta.strats.FullClassStrategy.map(FullClassStrategy.java:68)
      at org.apache.openjpa.jdbc.meta.ClassMapping.setStrategy(ClassMapping.java:343)
      at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:52)
      at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:768)
      at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1569)
      at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:654)
      at org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:615)
      at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:493)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:283)
      at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:271)
      at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:660)
      at org.apache.openjpa.jdbc.meta.MappingTool.validate(MappingTool.java:718)
      at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:634)
      at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1059)
      at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:966)
      at org.apache.openjpa.jdbc.meta.MappingTool.main(MappingTool.java:907)

        Activity

        Hide
        Sakari Maaranen added a comment -

        This is a particularly annoying bug with Eclipse, because currently Eclipse (Dali JPA Tools) does not recognize the default schema in orm.xml. Together these two bugs make it impossible to get around compiler warnings with Eclipse.

        Show
        Sakari Maaranen added a comment - This is a particularly annoying bug with Eclipse, because currently Eclipse (Dali JPA Tools) does not recognize the default schema in orm.xml. Together these two bugs make it impossible to get around compiler warnings with Eclipse.

          People

          • Assignee:
            Unassigned
            Reporter:
            Phill Moran
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development