Class JPQLCall

java.lang.Object
org.eclipse.persistence.queries.JPQLCall
All Implemented Interfaces:
Serializable, Cloneable, Call

public class JPQLCall extends Object implements Serializable, Call
Purpose: Used as an abstraction of a database invocation. A call is an JPQL string.

Responsibilities:

  • Parse the JPQL String
  • Populate the contained query's selection criteria. Add attributes to ReportQuery (if required).
See Also:
Author:
Jon Driscoll and Joel Lucuik
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected String
     
    protected DatabaseQuery
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PUBLIC: Create a new JPQLCall.
    JPQLCall(String jpqlString)
    PUBLIC: Create a new JPQLCall with an jpqlString.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
    INTERNAL: Return the appropriate mechanism, with the call added as necessary.
    org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
    buildQueryMechanism(DatabaseQuery query, org.eclipse.persistence.internal.queries.DatabaseQueryMechanism mechanism)
    INTERNAL: Return the appropriate mechanism, with the call added as necessary.
    INTERNAL: Return a clone of the call.
    INTERNAL: Return the string for the call
    INTERNAL: Return the EJBQL string for this call
    INTERNAL: Return the EJBQL string for this call
    getLogString(org.eclipse.persistence.internal.databaseaccess.Accessor accessor)
    INTERNAL: Return the SQL string for this call.
    Back reference to query, unfortunately required for events.
    INTERNAL: Return the SQL string for this call.
    boolean
    Return whether all the results of the call have been returned.
    boolean
    INTERNAL: Yes this is an JPQLCall
    boolean
    The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
    boolean
    The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
    boolean
    INTERNAL Is this query Parsed
    void
    populateQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
    Populate the query using the information retrieved from parsing the EJBQL.
    prepareStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
    INTERNAL: Prepare the JDBC statement, this may be parameterize or a call statement.
    void
    setEjbqlString(String jpqlString)
    INTERNAL: Set the EJBQL string for this call
    void
    setIsParsed(boolean newIsParsed)
    INTERNAL Set the isParsed state
    void
    setJPQLString(String jpqlString)
    INTERNAL: Set the JPQL string for this call
    void
    INTERNAL: Back reference to query, unfortunately required for events.
    INTERNAL: Print the JPQL string.
    void
    translate(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.internal.sessions.AbstractRecord modifyRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
    INTERNAL: translate method comment.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • query

      protected transient DatabaseQuery query
    • jpqlString

      protected String jpqlString
    • isParsed

      protected boolean isParsed
  • Constructor Details

    • JPQLCall

      public JPQLCall()
      PUBLIC: Create a new JPQLCall.
    • JPQLCall

      public JPQLCall(String jpqlString)
      PUBLIC: Create a new JPQLCall with an jpqlString.
  • Method Details

    • buildNewQueryMechanism

      public org.eclipse.persistence.internal.queries.DatabaseQueryMechanism buildNewQueryMechanism(DatabaseQuery query)
      INTERNAL: Return the appropriate mechanism, with the call added as necessary.
      Specified by:
      buildNewQueryMechanism in interface Call
    • buildQueryMechanism

      public org.eclipse.persistence.internal.queries.DatabaseQueryMechanism buildQueryMechanism(DatabaseQuery query, org.eclipse.persistence.internal.queries.DatabaseQueryMechanism mechanism)
      INTERNAL: Return the appropriate mechanism, with the call added as necessary.
      Specified by:
      buildQueryMechanism in interface Call
    • clone

      public Object clone()
      Description copied from interface: Call
      INTERNAL: Return a clone of the call.
      Specified by:
      clone in interface Call
      Overrides:
      clone in class Object
    • getCallString

      public String getCallString()
      INTERNAL: Return the string for the call
    • getEjbqlString

      public String getEjbqlString()
      INTERNAL: Return the EJBQL string for this call
    • getJPQLString

      public String getJPQLString()
      INTERNAL: Return the EJBQL string for this call
    • getQuery

      public DatabaseQuery getQuery()
      Back reference to query, unfortunately required for events.
    • getLogString

      public String getLogString(org.eclipse.persistence.internal.databaseaccess.Accessor accessor)
      INTERNAL: Return the SQL string for this call. Always return null since this is an EJBQL call
      Specified by:
      getLogString in interface Call
    • getSQLString

      public String getSQLString()
      INTERNAL: Return the SQL string for this call. Always return null since this is an EJBQL call
    • isJPQLCall

      public boolean isJPQLCall()
      INTERNAL: Yes this is an JPQLCall
    • isFinished

      public boolean isFinished()
      Return whether all the results of the call have been returned.
      Specified by:
      isFinished in interface Call
    • isParsed

      public boolean isParsed()
      INTERNAL Is this query Parsed
    • populateQuery

      public void populateQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
      Populate the query using the information retrieved from parsing the EJBQL.
    • prepareStatement

      public PreparedStatement prepareStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.internal.sessions.AbstractSession session) throws SQLException
      INTERNAL: Prepare the JDBC statement, this may be parameterize or a call statement. If caching statements this must check for the pre-prepared statement and re-bind to it.
      Throws:
      SQLException
    • setEjbqlString

      public void setEjbqlString(String jpqlString)
      INTERNAL: Set the EJBQL string for this call
    • setJPQLString

      public void setJPQLString(String jpqlString)
      INTERNAL: Set the JPQL string for this call
    • setIsParsed

      public void setIsParsed(boolean newIsParsed)
      INTERNAL Set the isParsed state
    • setQuery

      public void setQuery(DatabaseQuery query)
      INTERNAL: Back reference to query, unfortunately required for events.
    • translate

      public void translate(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.internal.sessions.AbstractRecord modifyRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
      INTERNAL: translate method comment.
    • isNothingReturned

      public boolean isNothingReturned()
      The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
      Specified by:
      isNothingReturned in interface Call
    • isOneRowReturned

      public boolean isOneRowReturned()
      The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
      Specified by:
      isOneRowReturned in interface Call
    • toString

      public String toString()
      INTERNAL: Print the JPQL string.
      Overrides:
      toString in class Object