IBM Support

PH36833: ECLIPSELINK SUPPORT FOR INPUT PARAMETERS IN SELECT CLAUSE

Subscribe

You can track all active APARs for this component.

 

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

    2026-07-08

  • 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

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Document Information

Modified date:
08 July 2026