OpenJPA
  1. OpenJPA
  2. OPENJPA-1697

A EnumValueHandler strategy along with XmlType annotation incorrectly mapped to XmlType in create table DDL

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: jdbc
    • Labels:
      None

      Description

      @Entity
      @Table(name="authority")
      @NamedQueries(

      { @NamedQuery(name = "AllIonAuthorities", query = "SELECT x FROM IonAuthority x") }

      )
      public class Authority {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "ID")
      private Integer id;

      @Enumerated( EnumType.STRING )
      @Column(nullable=false, length=128, updatable=true, insertable=true)
      @Persistent
      @Strategy("org.apache.openjpa.jdbc.meta.strats.EnumValueHandler")
      private AuthorityValues authorityName;

      -----------

      @XmlType(name = "IonAuthorityValues")
      @XmlEnum
      public enum AuthorityValues {

      AUTH1,
      AUTH2,

      Stacktrace:

      Caused by: <openjpa-2.1.0-SNAPSHOT-r422266:953182M nonfatal general error> org.apache.openjpa.persistence.PersistenceException: ORA-00907: missing right parenthesis

      {stmnt 13803851 CREATE TABLE authority (ID NUMBER NOT NULL, authorityName XMLType(128) NOT NULL, PRIMARY KEY (ID))}

      [code=907, state=42000]
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:556)
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:456)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:155)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:159)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:117)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:199)
      at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:213)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:151)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.invokeProxyMethod(AbstractEntityManagerFactoryBean.java:423)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:485)
      at $Proxy20.createEntityManager(Unknown Source)
      at com.iontrading.ionweb.persistence.SchemaCreationHandler.start(SchemaCreationHandler.java:181)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
      ... 27 more
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-00907: missing right parenthesis

      {stmnt 13803851 CREATE TABLE ion_authority (ID NUMBER NOT NULL, authorityName XMLType(128) NOT NULL, PRIMARY KEY (ID))}

      [code=907, state=42000]

        Issue Links

          Activity

          Milosz Tylenda made changes -
          Link This issue is related to OPENJPA-2046 [ OPENJPA-2046 ]
          Michael Dick made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Michael Dick added a comment -

          Closing issues which have been resolved for some time. If the problem persists, please reopen.

          Show
          Michael Dick added a comment - Closing issues which have been resolved for some time. If the problem persists, please reopen.
          Catalina Wei made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.1.0 [ 12314542 ]
          Resolution Fixed [ 1 ]
          Catalina Wei made changes -
          Summary A EnumValueHandler strategy along with XmlType annotation incorrectly mapped to XmlType in create table DDL for Oracle A EnumValueHandler strategy along with XmlType annotation incorrectly mapped to XmlType in create table DDL
          Hide
          Catalina Wei added a comment -

          This problem is not unique to Oracle.

          Show
          Catalina Wei added a comment - This problem is not unique to Oracle.
          Catalina Wei made changes -
          Field Original Value New Value
          Assignee Catalina Wei [ fancy ]
          Catalina Wei created issue -

            People

            • Assignee:
              Catalina Wei
              Reporter:
              Catalina Wei
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development