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

OpenJPA 1.1.0 doesn't allow collection-type fields to have @Column defined on them, while OpenJPA 1.0.0 does.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: third-party
    • Labels:
      None

      Description

      IBM U2 databases allow a single field to store multiple-values. So we use mappings as following to map such a multi-valued field.

      @Column(name="ADDRESS")
      @PersistentCollection(fetch=FetchType.EAGER)
      private String[] address;

      @Column(name="CATEGORIES_LIKED")
      @PersistentCollection(fetch=FetchType.EAGER)
      private String[] categories_liked;

      This worked fine with OpenJPA 1.0.0. But the new OpenJPA 1.1.0 throws exceptions like the following when parsing the mapping, is there a way to bring back the behavior of OpenJPA 1.0.0?

      <openjpa-1.1.0-r422266:657916 fatal user error> org.apache.openjpa.persistence.ArgumentException: You have supplied columns for "sampleear.Customer.categories_liked", but this mapping cannot have columns in this context.
      at org.apache.openjpa.jdbc.meta.MappingInfo.assertNoSchemaComponents(MappingInfo.java:327)
      at org.apache.openjpa.jdbc.meta.strats.HandlerCollectionTableFieldStrategy.map(HandlerCollectionTableFieldStrategy.java:100)
      at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:120)
      at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
      at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:438)
      at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:403)
      at org.apache.openjpa.jdbc.meta.ClassMapping.resolveNonRelationMappings(ClassMapping.java:851)
      at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:808)
      at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1625)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              maojianfeng Jianfeng Mao
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: