- 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).
- Since:
- TopLink 4.0
- Author:
- Jon Driscoll and Joel Lucuik
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisParsedprotected StringjpqlStringprotected DatabaseQueryquery
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatabaseQueryMechanismbuildNewQueryMechanism(DatabaseQuery query)INTERNAL: Return the appropriate mechanism, with the call added as necessary.DatabaseQueryMechanismbuildQueryMechanism(DatabaseQuery query, DatabaseQueryMechanism mechanism)INTERNAL: Return the appropriate mechanism, with the call added as necessary.Objectclone()INTERNAL: Return a clone of the call.StringgetCallString()INTERNAL: Return the string for the callStringgetEjbqlString()INTERNAL: Return the EJBQL string for this callStringgetJPQLString()INTERNAL: Return the EJBQL string for this callStringgetLogString(Accessor accessor)INTERNAL: Return the SQL string for this call.DatabaseQuerygetQuery()Back reference to query, unfortunately required for events.StringgetSQLString()INTERNAL: Return the SQL string for this call.booleanisFinished()Return whether all the results of the call have been returned.booleanisJPQLCall()INTERNAL: Yes this is an JPQLCallbooleanisNothingReturned()The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.booleanisOneRowReturned()The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.booleanisParsed()INTERNAL Is this query ParsedvoidpopulateQuery(AbstractSession session)Populate the query using the information retrieved from parsing the EJBQL.PreparedStatementprepareStatement(DatabaseAccessor accessor, AbstractRecord translationRow, AbstractSession session)INTERNAL: Prepare the JDBC statement, this may be parameterize or a call statement.voidsetEjbqlString(String jpqlString)INTERNAL: Set the EJBQL string for this callvoidsetIsParsed(boolean newIsParsed)INTERNAL Set the isParsed statevoidsetJPQLString(String jpqlString)INTERNAL: Set the JPQL string for this callvoidsetQuery(DatabaseQuery query)INTERNAL: Back reference to query, unfortunately required for events.StringtoString()INTERNAL: Print the JPQL string.voidtranslate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)INTERNAL: translate method comment.
-
-
-
Field Detail
-
query
protected transient DatabaseQuery query
-
jpqlString
protected String jpqlString
-
isParsed
protected boolean isParsed
-
-
Constructor Detail
-
JPQLCall
public JPQLCall()
PUBLIC: Create a new JPQLCall.
-
JPQLCall
public JPQLCall(String jpqlString)
PUBLIC: Create a new JPQLCall with an jpqlString.
-
-
Method Detail
-
buildNewQueryMechanism
public DatabaseQueryMechanism buildNewQueryMechanism(DatabaseQuery query)
INTERNAL: Return the appropriate mechanism, with the call added as necessary.- Specified by:
buildNewQueryMechanismin interfaceCall
-
buildQueryMechanism
public DatabaseQueryMechanism buildQueryMechanism(DatabaseQuery query, DatabaseQueryMechanism mechanism)
INTERNAL: Return the appropriate mechanism, with the call added as necessary.- Specified by:
buildQueryMechanismin interfaceCall
-
clone
public Object clone()
Description copied from interface:CallINTERNAL: Return a clone of the call.
-
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(Accessor accessor)
INTERNAL: Return the SQL string for this call. Always return null since this is an EJBQL call- Specified by:
getLogStringin interfaceCall
-
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:
isFinishedin interfaceCall
-
isParsed
public boolean isParsed()
INTERNAL Is this query Parsed
-
populateQuery
public void populateQuery(AbstractSession session)
Populate the query using the information retrieved from parsing the EJBQL.
-
prepareStatement
public PreparedStatement prepareStatement(DatabaseAccessor accessor, AbstractRecord translationRow, 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(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)
INTERNAL: translate method comment.
-
isNothingReturned
public boolean isNothingReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.- Specified by:
isNothingReturnedin interfaceCall
-
isOneRowReturned
public boolean isOneRowReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.- Specified by:
isOneRowReturnedin interfaceCall
-
-