com.holonplatform.datastore.jpa.jpql

## Interface JPQLResultConverter<Q,R>

- Type Parameters:
    `Q` - Query result type
    `R` - Expected result type

      public interface JPQLResultConverter<Q,R>

  Jpa query result converter.
  Since:
    5.0.0

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `R` | `convert(JpaExecutionContext context, Q result)` Convert a query result into expected result type.
    `Class<? extends R>` | `getConversionType()` Get the type into which this converter is able to convert a result.
    `Class<? extends Q>` | `getQueryResultType()` Get the query result type.
    `static <T> JPQLResultConverter<T,T>` | `identity(Class<? extends T> type)` Create a `JPQLResultConverter` which does not perform any result conversion.

- - ### Method Detail

    - #### getQueryResultType

          Class<? extends Q> getQueryResultType()

      Get the query result type.
      Returns:
        The query result type

    - #### getConversionType

          Class<? extends R> getConversionType()

      Get the type into which this converter is able to convert a result.
      Returns:
        The conversion type

    - #### convert

          R convert(JpaExecutionContext context,
                    Q result)
             throws com.holonplatform.core.exceptions.DataAccessException

      Convert a query result into expected result type.
      Parameters:
        `context` - Execution context
        `result` - Result to convert
      Returns:
        Converted result
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If the conversion failed

    - #### identity

          static <T> JPQLResultConverter<T,T> identity(Class<? extends T> type)

      Create a `JPQLResultConverter` which does not perform any result conversion.
      Type Parameters:
        `T` - Query result type
      Parameters:
        `type` - Query result type (not null)
      Returns:
        A new identity `JPQLResultConverter`

Copyright © 2019 The Holon Platform. All rights reserved.