Package org.eclipse.persistence.queries
Class JPQLCall
- java.lang.Object
-
- org.eclipse.persistence.queries.JPQLCall
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Call
public class JPQLCall extends java.lang.Object implements java.io.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:
- Serialized Form
- Author:
- Jon Driscoll and Joel Lucuik
- Since:
- TopLink 4.0
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isParsed
protected java.lang.String
jpqlString
protected DatabaseQuery
query
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
buildNewQueryMechanism(DatabaseQuery query)
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.java.lang.Object
clone()
INTERNAL: Return a clone of the call.java.lang.String
getCallString()
INTERNAL: Return the string for the calljava.lang.String
getEjbqlString()
INTERNAL: Return the EJBQL string for this calljava.lang.String
getJPQLString()
INTERNAL: Return the EJBQL string for this calljava.lang.String
getLogString(org.eclipse.persistence.internal.databaseaccess.Accessor accessor)
INTERNAL: Return the SQL string for this call.DatabaseQuery
getQuery()
Back reference to query, unfortunately required for events.java.lang.String
getSQLString()
INTERNAL: Return the SQL string for this call.boolean
isFinished()
Return whether all the results of the call have been returned.boolean
isJPQLCall()
INTERNAL: Yes this is an JPQLCallboolean
isNothingReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.boolean
isOneRowReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.boolean
isParsed()
INTERNAL Is this query Parsedvoid
populateQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
Populate the query using the information retrieved from parsing the EJBQL.java.sql.PreparedStatement
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(java.lang.String jpqlString)
INTERNAL: Set the EJBQL string for this callvoid
setIsParsed(boolean newIsParsed)
INTERNAL Set the isParsed statevoid
setJPQLString(java.lang.String jpqlString)
INTERNAL: Set the JPQL string for this callvoid
setQuery(DatabaseQuery query)
INTERNAL: Back reference to query, unfortunately required for events.java.lang.String
toString()
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.
-
-
-
Field Detail
-
query
protected transient DatabaseQuery query
-
jpqlString
protected java.lang.String jpqlString
-
isParsed
protected boolean isParsed
-
-
Method Detail
-
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 interfaceCall
-
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 interfaceCall
-
clone
public java.lang.Object clone()
Description copied from interface:Call
INTERNAL: Return a clone of the call.
-
getCallString
public java.lang.String getCallString()
INTERNAL: Return the string for the call
-
getEjbqlString
public java.lang.String getEjbqlString()
INTERNAL: Return the EJBQL string for this call
-
getJPQLString
public java.lang.String getJPQLString()
INTERNAL: Return the EJBQL string for this call
-
getQuery
public DatabaseQuery getQuery()
Back reference to query, unfortunately required for events.
-
getLogString
public java.lang.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 interfaceCall
-
getSQLString
public java.lang.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 interfaceCall
-
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 java.sql.PreparedStatement prepareStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.internal.sessions.AbstractSession session) throws java.sql.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:
java.sql.SQLException
-
setEjbqlString
public void setEjbqlString(java.lang.String jpqlString)
INTERNAL: Set the EJBQL string for this call
-
setJPQLString
public void setJPQLString(java.lang.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 interfaceCall
-
isOneRowReturned
public boolean isOneRowReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.- Specified by:
isOneRowReturned
in interfaceCall
-
toString
public java.lang.String toString()
INTERNAL: Print the JPQL string.- Overrides:
toString
in classjava.lang.Object
-
-