OpenJPA
  1. OpenJPA
  2. OPENJPA-224

columnDefinition on @Column doesn't work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 0.9.6
    • Fix Version/s: None
    • Component/s: jpa
    • Labels:
      None

      Description

      I tried to specify @Column(name = "C_APPLICATION_NUMBER", columnDefinition="nvarchar(250)") but it still generates C_APPLICATION_NUMBER VARCHAR2(255) as column declaration. I need to user NVARCHAR2(250) to support national charset. Any idea why it doesn't work?

        Activity

        Hide
        Milosz Tylenda added a comment -

        Closing as not reproducible.

        Show
        Milosz Tylenda added a comment - Closing as not reproducible.
        Hide
        Jacek Laskowski added a comment -

        What database do you use? I ran a test case with an entity annotated with @Column(name = "C_APPLICATION_NUMBER", columnDefinition="nvarchar(250)") and guess what I'd got:

        Tests run: 3, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 4.062 sec <<< FAILURE!
        setUp(pl.jaceklaskowski.jpa.issue.ATest) Time elapsed: 0 sec <<< FAILURE!
        <0.9.8-incubating-SNAPSHOT nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Feature not implemented: NATIONAL CHAR VARYING.

        {stmnt 19762893 CREATE TABLE A (id BIGINT NOT NULL, C_APPLICATION_NUMBER nvarchar(250), col2 VARCHAR(4), PRIMARY KEY (id))}

        [code=30000, state=0A000]
        at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:543)
        at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:443)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:167)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:127)
        at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:171)
        at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:139)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:187)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:140)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:52)
        at pl.jaceklaskowski.jpa.BaseTest.setUp(BaseTest.java:37)
        ...

        It works with OpenJPA 0.9.8-incubating-SNAPSHOT and Derby that doesn't support nvarchar (I think some db dictionary translation is involved here so the type of DB is important to note).

        Could you give 0.9.8-incubator-SNAPSHOT a shot? You'll need to build it from the sources.

        Show
        Jacek Laskowski added a comment - What database do you use? I ran a test case with an entity annotated with @Column(name = "C_APPLICATION_NUMBER", columnDefinition="nvarchar(250)") and guess what I'd got: Tests run: 3, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 4.062 sec <<< FAILURE! setUp(pl.jaceklaskowski.jpa.issue.ATest) Time elapsed: 0 sec <<< FAILURE! <0.9.8-incubating-SNAPSHOT nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Feature not implemented: NATIONAL CHAR VARYING. {stmnt 19762893 CREATE TABLE A (id BIGINT NOT NULL, C_APPLICATION_NUMBER nvarchar(250), col2 VARCHAR(4), PRIMARY KEY (id))} [code=30000, state=0A000] at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:543) at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:443) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:167) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:127) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:171) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:139) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:187) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:140) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:52) at pl.jaceklaskowski.jpa.BaseTest.setUp(BaseTest.java:37) ... It works with OpenJPA 0.9.8-incubating-SNAPSHOT and Derby that doesn't support nvarchar (I think some db dictionary translation is involved here so the type of DB is important to note). Could you give 0.9.8-incubator-SNAPSHOT a shot? You'll need to build it from the sources.

          People

          • Assignee:
            Unassigned
            Reporter:
            Daniel Gajdos
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development