IBM Support

PH36833: ECLIPSELINK SUPPORT FOR INPUT PARAMETERS IN SELECT CLAUSE

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • EclipseLink throws an exception for CriteriaBuilder queries
    that contain parameter expressions in the SELECT clause.
    However, EclipseLink does not throw an exception for JPQL
    queries that contain parameters in the SELECT clause and
    instead execute without issue. This fix is to allow
    EclipseLink's CriteriaBuilder queries to allow parameters in
    SELECT clause the same as the JPQL implementation.
    
    Exception example:
    ´´´
    org.eclipse.persistence.exceptions.QueryException
    Exception Description: The parameter name [stringValue] in the
    query's selection criteria does not match any parameter name
    defined in the query.
    ´´´
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server - Java Persistence API - JPA 2.1 &   *
    *                  EclipseLink                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: Add support for input parameters        *
    *                      within EclipseLinks CriteriaBuilder     *
    *                      implementation                          *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Example:
    ´´´
    CriteriaBuilder cb = em.getCriteriaBuilder();
    cquery = cb.createQuery(Object[].class);
    root = cquery.from(SimpleEntity.class);
    cquery.multiselect(root.get(SimpleEntity_.strVal1),
    cb.parameter(String.class, "stringValue"));
    cquery.where(cb.equal(root.get(SimpleEntity_.intVal1),
    cb.parameter(Long.class, "idValue")));
    query = em.createQuery(cquery);
    query.setParameter("stringValue", "HELLO");
    query.setParameter("idValue", 4);
    query.getResultList();
    ´´´
    Example exception:
    ´´´
    org.eclipse.persistence.exceptions.QueryException
    Exception Description: The parameter name [stringValue] in the
    query's selection criteria does not match any parameter name
    defined in the query.
    Query: ReportQuery(referenceClass=SimpleEntity sql="SELECT
    STRVAL1, ? FROM SIMPLEENTITY WHERE (INTVAL1 = ?)")
    at
    org.eclipse.persistence.exceptions.QueryException.parameterNameM
    ismatch(QueryException.java:1098)
    at
    org.eclipse.persistence.internal.expressions.ParameterExpression
    .getValue(ParameterExpression.java:290)
    at
    org.eclipse.persistence.internal.databaseaccess.DatabaseCall.tra
    nslate(DatabaseCall.java:1147)
    at
    org.eclipse.persistence.internal.queries.DatasourceCallQueryMech
    anism.executeCall(DatasourceCallQueryMechanism.java:276)
    ´´´
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH36833

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2021-04-29

  • Closed date

    2021-07-07

  • Last modified date

    2021-07-07

  • 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 APP S

  • Fixed component ID

    5724J0800

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":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"900"}]

Document Information

Modified date:
16 July 2021