java.lang.Object
org.eclipse.persistence.queries.DatabaseQuery
org.eclipse.persistence.internal.jpa.JPAQuery
All Implemented Interfaces:
Serializable, Cloneable

public class JPAQuery extends DatabaseQuery
Purpose: A JPA placeholder Query object to store JPQL strings so that processing the string is delayed until Login.
Since:
TopLink Essentials
See Also:
  • Constructor Details

  • Method Details

    • addResultClassNames

      public void addResultClassNames(String className)
    • addResultSetMapping

      public void addResultSetMapping(String resultSetMapping)
    • executeDatabaseQuery

      public Object executeDatabaseQuery() throws DatabaseException, OptimisticLockException
      INTERNAL: This should never be called and is only here because it is needed as an extension to DatabaseQuery. Perhaps exception should be thrown to warn users, but for now it will execute the resulting query instead, this allows JPA style queries to be executed on a normal EclipseLink Session.
      Specified by:
      executeDatabaseQuery in class DatabaseQuery
      Returns:
      - the result of executing the query.
      Throws:
      DatabaseException - - an error has occurred on the database.
      OptimisticLockException - - an error has occurred using the optimistic lock feature.
    • getDatabaseQuery

      public DatabaseQuery getDatabaseQuery()
    • getDescriptors

      public List<ClassDescriptor> getDescriptors()
      INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.
      Overrides:
      getDescriptors in class DatabaseQuery
    • getHints

      public Map<String,Object> getHints()
      Return the JPA query hints.
    • getJPQLString

      public String getJPQLString()
      Return the JPQL string.
      Overrides:
      getJPQLString in class DatabaseQuery
    • isJPQLQuery

      public boolean isJPQLQuery()
      Return true if this query is a jpql query.
    • isSQLQuery

      public boolean isSQLQuery()
      Return true if this query is an sql query.
    • prepare

      public void prepare()
      INTERNAL: Generate the DatabaseQuery query from the JPA named query.
      Overrides:
      prepare in class DatabaseQuery
    • processJPQLQuery

      public DatabaseQuery processJPQLQuery(Session session)
      INTERNAL: Convert the JPA query into a DatabaseQuery.
    • processSQLQuery

      public DatabaseQuery processSQLQuery(Session session)
      INTERNAL: Convert the SQL string into a DatabaseQuery.
    • processStoredProcedureQuery

      public DatabaseQuery processStoredProcedureQuery(Session session)
      INTERNAL: Convert the StoredProc call into a DatabaseQuery.
    • setDatabaseQuery

      public void setDatabaseQuery(DatabaseQuery databaseQuery)
    • setDescriptors

      public void setDescriptors(List<ClassDescriptor> descriptors)
      INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.
    • setHints

      public void setHints(Map<String,Object> hints)
    • setJPQLString

      public void setJPQLString(String jpqlString)
      Description copied from class: DatabaseQuery
      PUBLIC: Set the JPQL string of the query. If arguments are required in the string they will be preceded by ":" then the argument name. The JPQL arguments must also be added as argument to the query.
      Overrides:
      setJPQLString in class DatabaseQuery
    • setResultClassName

      public void setResultClassName(String className)
    • setResultSetMappings

      public void setResultSetMappings(List<String> resultSetMappings)