org.apache.ignite.springdata22.repository.query

## Class QueryUtils

- java.lang.Object
- - org.apache.ignite.springdata22.repository.query.QueryUtils

-     public abstract class QueryUtils
      extends Object

  Simple utility class to create queries.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COUNT_QUERY_STRING` The constant COUNT_QUERY_STRING.
    `static String` | `DELETE_ALL_QUERY_STRING` The constant DELETE_ALL_QUERY_STRING.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `getExistsQueryString(String entityName, String cntQryPlaceHolder, Iterable<String> idAttrs)` Returns the query string to execute an exists query for the given id attributes.
    `static String` | `getProjection(String qry)` Returns the projection part of the query, i.e. everything between `select` and `from`.
    `static String` | `getQueryString(String template, String entityName)` Returns the query string for the given class name.
    `static boolean` | `hasConstructorExpression(String qry)` Returns whether the given JPQL query contains a constructor expression.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### COUNT_QUERY_STRING

          public static final String COUNT_QUERY_STRING

      The constant COUNT_QUERY_STRING.
      See Also:
        Constant Field Values

    - #### DELETE_ALL_QUERY_STRING

          public static final String DELETE_ALL_QUERY_STRING

      The constant DELETE_ALL_QUERY_STRING.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getExistsQueryString

          public static String getExistsQueryString(String entityName,
                                                    String cntQryPlaceHolder,
                                                    Iterable<String> idAttrs)

      Returns the query string to execute an exists query for the given id attributes.
      Parameters:
        `entityName` - the name of the entity to create the query for, must not be null.
        `cntQryPlaceHolder` - the placeholder for the count clause, must not be null.
        `idAttrs` - the id attributes for the entity, must not be null.
      Returns:
        the exists query string

    - #### getQueryString

          public static String getQueryString(String template,
                                              String entityName)

      Returns the query string for the given class name.
      Parameters:
        `template` - must not be null.
        `entityName` - must not be null.
      Returns:
        the template with placeholders replaced by the entityName. Guaranteed to be not null.

    - #### hasConstructorExpression

          public static boolean hasConstructorExpression(String qry)

      Returns whether the given JPQL query contains a constructor expression.
      Parameters:
        `qry` - must not be null or empty.
      Returns:
        boolean

    - #### getProjection

          public static String getProjection(String qry)

      Returns the projection part of the query, i.e. everything between `select` and `from`.
      Parameters:
        `qry` - must not be null or empty.
      Returns:
        projection

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020