IBM Support

PM70566: DEFAULT JOIN-COLUMN IS NOT BEING OVERRIDDEN BY THE @JOINCOLUMN ANNOTATION'S NAME PROPERTY

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When the SQL for a named query is generated, the "name"
    attribute of a @JoinColumn is ignored when the "table" attribute
    is also specified. This is issue is specific to  JPA 2.x only.
    
    
    Following error may be noted
    
    ERROR: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703,
    SQLERRMC=T1.OWNER_EMPNO, DRIVER=3.57.82 {prepstmnt 65007978
    SELECT
    t0.hwserial, t0.hwtype, t1.empno, t0.hwname, t2.empno,
    t2.empname FROM
    HWASSETS t0 INNER JOIN HWASSETSOWNERSHIP t1 ON t0.hwtype =
    t1.HWTYPE AND
    t0.hwserial = t1.HWSERIAL LEFT OUTER JOIN PEOPLE t2 ON
    t1.OWNER_EMPNO =
    t2.empno WHERE (t1.empno = ?) [params=?]} [code=-206,
    state=42703]SQLCA
    OUTPUT[Errp=SQLNQ075, Errd=-2145779603, 0, 0, 0, -10, 0] DB2 SQL
    Error:
    SQLCODE=-206, SQLSTATE=42703, SQLERRMC=T1.OWNER_EMPNO,
    DRIVER=3.57.82
    DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098,
    SQLERRMC=2;-206;42703;T1.OWNER_EMPNO, DRIVER=3.57.82 DB2 SQL
    Error:
    SQLCODE=-727, SQLSTATE=56098,
    SQLERRMC=2;-206;42703;T1.OWNER_EMPNO,
    DRIVER=3.57.82
    

Local fix

  • try adding the following line to the preperties section of
    the persistence.xml file
    <property name="openjpa.Compatibility"
    value="NonDefaultMappingAllowed=false"/>
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.0 and V8.5 who make use of        *
    *                  @JoinColumn name when mapping a             *
    *                  unidirectional owned OneToOne that is in a  *
    *                  SecondaryTable.                             *
    ****************************************************************
    * PROBLEM DESCRIPTION: JoinColumn annotation is ignored when   *
    *                      mapping a unidirectional owned          *
    *                      OneToOne that is in a SecondaryTable .  *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The OpenJPA runtime incorrectly ignores @JoinColumn name when
    mapping a unidirectional owned OneToOne that is in a
    SecondaryTable.
    This problem only exists when running with a persistence.xml
    that is set to 2.0 (version="2.0">).
    For example:
    @Entity
    @SecondaryTable(name = "ParentSecondaryTable", pkJoinColumns =
    { @PrimaryKeyJoinColumn(name = "idParent",
    referencedColumnName = "idParent") })
    public class Parent {
    @Id
    @GeneratedValue
    int idParent;
    String child_ref;
    @OneToOne
    @JoinColumn(name = "CHILD_REF", table =
    "ParentSecondaryTable", referencedColumnName = "idChild")
    PChild child;
    }
    The column "CHILD_REF" will be ignored and the runtime will
    look for the Foreign Key in non-existent column
    ParentSecondaryTable.CHILD_IDCHILD.
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to ensure the
    JoinColumn annotation's name field is not ignored in a
    unidirectional OneToOne mapping that is in a SecondaryTable
    
    The fix for this APAR is currently targeted for
    inclusion in Service Levels (Fix Packs) 8.0.0.6 and
    8.5.0.2 of WebSphere Application Server versions 8.0.0 and
    8.5.0.
    
    Please refer to the recommended updates page for delivery
    information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM70566

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-08-08

  • Closed date

    2013-01-02

  • Last modified date

    2013-01-02

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    PM78151 PM80441

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R800 PSY

       UP

  • R850 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
29 October 2021