예제 #1
0
  /**
   * Registers the input parameters derived from the JPQL expression with the {@link DatabaseQuery}.
   *
   * @param queryContext The {@link JPQLQueryContext} containing the information about the JPQL
   *     query
   * @param databaseQuery The EclipseLink {@link DatabaseQuery} where the input parameter types are
   *     added
   */
  private void addArguments(JPQLQueryContext queryContext, DatabaseQuery databaseQuery) {

    if (queryContext.inputParameters != null) {

      for (Map.Entry<InputParameter, Expression> entry : queryContext.inputParameters.entrySet()) {
        ParameterExpression parameter = (ParameterExpression) entry.getValue();

        databaseQuery.addArgument(
            parameter.getField().getName(),
            (Class<?>) parameter.getType(),
            entry.getKey().isPositional() ? ParameterType.POSITIONAL : ParameterType.NAMED);
      }
    }
  }