Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 2.0.0-M3
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available
    1. OPENJPA-946.patch
      25 kB
      Tim McConnell

      Issue Links

        Activity

        Tim McConnell created issue -
        Tim McConnell made changes -
        Field Original Value New Value
        Attachment OPENJPA-946.patch [ 12401584 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946.patch [ 12401584 ]
        Ravi P Palacherla made changes -
        Comment [ Hi,

        I was trying to run TestEJBState against oracleDB and I need to get this JIRA issue fixed as part of it.

        So, I spent some time and I think I can do one of the two things to get this fixed:

        1) To change the "openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ProxiesPC.java" to replace the variable name of "date" to something like "date0." ( this is more like a workaround rather than an actual fix.)

        2) I found the cause of this issue but I need some one to please review my proposed fix before I submit the patch.

        The actual fix should go inside "correctName(Table table, Column col)" method of class "openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingDefaultsImpl.java"
        If you check the method , "col.setName(dict.getValidColumnName(name, table));" is called only if _defMissing is false. But "_defMissing" is set to true from "PersistenceMappingDefaults.java".

        "_defMissing" represents DefaultMissingInfo and as per the doc, DefaultMissingInfo is to determine Whether to default missing column and table names rather than throw an exception.

        So, if "_defMissing" is true then we have to set the column name properly rather than throwing exception ( For example, if column uses reserve word then we have to replace the column name.)

        But here the opposite is happening meaning, we are changing the column name only if the "_defMissing" is false.

        So, the resolution would be to change correctName to:

        protected void correctName(Table table, Column col) {
        if (_defMissing || _removeHungarianNotation) // Replaced !_defMissing with _defMissing )
        {
          String name = col.getName();
          if (_removeHungarianNotation)
            name = removeHungarianNotation(name);
            col.setName(dict.getValidColumnName(name, table));
        }
        }

        Also as stated under (http://n2.nabble.com/Question-regarding-DefaultMissingInfo-of-MappingDefaults-property.-td2657689.html)

        I also tried to use
        case 1: <property name="openjpa.jdbc.MappingDefaults" value="default(DefaultMissingInfo=true)"/> or
        case 2: <property name="openjpa.jdbc.MappingDefaults" value="default(DefaultMissingInfo=false)"/> or
        case 3: <property name="openjpa.jdbc.MappingDefaults" value="jpa"/> ( default)

        but it did not help; meaning none of the above cases chaged the value of "_defMissing" and hence "col.setName(dict.getValidColumnName(name, table));" is not called, which is the cause of the issue.

        Can someone please review the change before I submit the patch.
        The reason for asking someone to review is because I think I did not understand the concept DefaultMissingInfo properly.

        Thanks,
        Ravi. ]
        Tim McConnell made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Tim McConnell made changes -
        Patch Info [Patch Available]
        Tim McConnell made changes -
        Attachment OPENJPA-946.patch [ 12407595 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946-2.patch [ 12407941 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946-3.patch [ 12407948 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946-2.patch [ 12407941 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946.patch [ 12407595 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946-4.patch [ 12408097 ]
        Tim McConnell made changes -
        Status In Progress [ 3 ] Open [ 1 ]
        Tim McConnell made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.0 [ 12313483 ]
        Resolution Fixed [ 1 ]
        Donald Woods made changes -
        Fix Version/s 1.3.0 [ 12313326 ]
        Tim McConnell made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946-5.patch [ 12411183 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946-3.patch [ 12407948 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946-4.patch [ 12408097 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946-5.patch [ 12411183 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946.patch [ 12411485 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946.patch [ 12411485 ]
        Tim McConnell made changes -
        Attachment OPENJPA-946.patch [ 12411486 ]
        Donald Woods made changes -
        Assignee Tim McConnell [ mcconne ] Donald Woods [ drwoods ]
        Donald Woods made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Fix Version/s 2.0.0-M2 [ 12313483 ]
        Resolution Fixed [ 1 ]
        Rick Curtis made changes -
        Link This issue incorporates OPENJPA-1145 [ OPENJPA-1145 ]
        Donald Woods made changes -
        Fix Version/s 2.0.0-M3 [ 12314148 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Donald Woods
            Reporter:
            Tim McConnell
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development