IBM Support

PH03523: ECLIPSELINK CRITERIA API DOESNT SUPPORT MULIPLE CONSTRUCTORS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Description: Using the JPA Criteria API to construct
    javax.persistence.criteria.CompoundSelection objects with
    multiple constructor classes returns a result of 'null'.
    EclipseLink does not correctly use the constructor classes
    constructor.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty - Java Persistence APA -     *
    *                  JPA 2.1 & EclipseLink                       *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink returns a null result for   *
    *                      CriteriaQuerys that contain multiple    *
    *                      CompoundSelection objects               *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When constructing a CompoundSelection that references another
    CompoundSelection, EclipseLink does not not correctly use the
    class constructor. This leads the CriteriaQuery to return a
    null result for the sub-CompoundSelection.
    Example:
    @Test
    public void testCriteriaCompoundSelectionModel() {
    EntityManager em = emf.createEntityManager();
    final CriteriaBuilder builder = em.getCriteriaBuilder();
    final CriteriaQuery<L1Model> query =
    builder.createQuery(L1Model.class);
    final Root<L1> root = query.from(L1.class);
    final Join<L1, L2> l1ToL2 = root.join(L1_.l2);
    final CompoundSelection<L2Model> selection_l2 =
    builder.construct(L2Model.class, l1ToL2.get(L2_.id),
    l1ToL2.get(L2_.name));
    final CompoundSelection<L1Model> selection =
    builder.construct(L1Model.class, root.get(L1_.id),
    root.get(L1_.name), selection_l2);
    query.select(selection);
    TypedQuery<L1Model> q = em.createQuery(query);
    List<L1Model> l1List = q.getResultList();
    System.out.println("=== results ===");
    if (l1List != null && !l1List.isEmpty()) {
    for (L1Model l1m : l1List) {
    System.out.println(l1m.toString());
    Assert.assertNotNull(l1m.getL2());
    }
    }
    em.close();
    }
    Output:
    === results ===
    L1Model [id=1, name=L1-1, l2=null]
    L1Model [id=2, name=L1-2, l2=null]
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH03523

  • Reported component name

    WEBSPHERE FOR Z

  • Reported component ID

    5655I3500

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-10-02

  • Closed date

    2018-11-19

  • Last modified date

    2018-11-19

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

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

Fix information

  • Fixed component name

    WEBSPHERE FOR Z

  • Fixed component ID

    5655I3500

Applicable component levels

  • R900 PSY

       UP

[{"Line of Business":{"code":"LOB36","label":"IBM Automation"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SS7K4U","label":"WebSphere Application Server for z\/OS"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"900"}]

Document Information

Modified date:
08 September 2021