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

XML overriding column names for 1xM attributes causes exception.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.3, 2.0.2, 2.1.1, 2.2.0
    • 1.2.3, 2.2.0
    • jdbc
    • None

    Description

      Entity with 1xm relationship define in orm.xml causes the following exception during emf.createEntityManager.

      + //Removing the XML from the orm.xml file, and using this fixes the issue:
      + //@OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
      + private List<XMLManyToOneEntity> xmlManyToOneList = new ArrayList<XMLManyToOneEntity>(0);

      And this mapping in the orm.xml:

      + <one-to-many name="xmlManyToOneList" fetch="LAZY">
      + <join-column name="IDENTITY" />
      + <cascade>
      + <cascade-all/>
      + </cascade>

      <openjpa-2.2.0-SNAPSHOT-r422266:1235624 fatal user error> org.apache.openjpa.persistence.ArgumentException: You have supplied columns for "org.apache.openjpa.persistence.arrays.model.XMLOneToManyEntity.xmlManyToOneList", but this mapping cannot have columns in this context.
      at org.apache.openjpa.jdbc.meta.MappingInfo.assertNoSchemaComponents(MappingInfo.java:382)
      at org.apache.openjpa.jdbc.meta.strats.RelationToManyTableFieldStrategy.map(RelationToManyTableFieldStrategy.java:97)
      at org.apache.openjpa.jdbc.meta.strats.RelationCollectionTableFieldStrategy.map(RelationCollectionTableFieldStrategy.java:95)
      at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:146)
      at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:82)
      at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:496)
      at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:461)
      at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:865)
      at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1802)
      at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:821)
      at org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:776)
      at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:656)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:410)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:383)
      at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:352)
      at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:682)
      at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool.java:754)
      at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:652)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:154)

      Attachments

        Issue Links

          Activity

            People

              allee8285 Albert Lee
              allee8285 Albert Lee
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: