com.apama.database
Event PreparedQuery


Event containing the actions to create a prepared query statement on a database.

See init(), create(), delete(), and setExtraParms()
Routes:
com.apama.database.CreatePreparedQuery - 
com.apama.database.DeletePreparedQuery - 
Listens:
com.apama.database.PreparedQueryAck - 

Action summary
 voidcreate(action<com.apama.database.PreparedQuerystring> callback)

Create the prepared query on the database, which can later be reused against queries.
 voiddelete(action<com.apama.database.PreparedQuerystring> callback)

Delete the prepared query form the database.
 com.apama.database.ConnectiongetConnection()

Returns the connection to the database.
 integergetId()

Returns the messageId that was used to create the prepared query.
 integergetPreparedQueryId()

Returns the id of the prepared query.
 stringgetQueryString()

Returns the query string that was used to create the prepared query.
 voidinit(com.apama.database.Connection conn, string queryString, sequence<string> inputTypes, sequence<string> outputTypes)

Initialize the prepared query elements with the query string, input and output types.
 voidinitPreSpawnContext(context preSpawnContext)

Set context that is current prior to spawning.
 voidonBeginRecovery()

OnBeginRecovery is called after all objects and listeners of persistent monitors have been recovered and before queued events are processed.
 voidonConcludeRecovery()

OnConcludeRecovery is called after the recovery process has been completed, including all non persistent monitors having being re-loaded.
 voidsetExtraParams(dictionary<stringstring> extra)

Additional parameters for the prepared query.
 
Action detail

create

void create(action<com.apama.database.PreparedQuerystring> callback)
Create the prepared query on the database, which can later be reused against queries.

This is created based on the elements that were set up in the init action.
Parameters:
callback - User defined action called when the current action completes.
Routes:
com.apama.database.CreatePreparedQuery - 
Listens:
com.apama.database.PreparedQueryAck - 

delete

void delete(action<com.apama.database.PreparedQuerystring> callback)
Delete the prepared query form the database.
Parameters:
callback - User defined action called when the current action completes.
Routes:
com.apama.database.DeletePreparedQuery - 
Listens:
com.apama.database.PreparedQueryAck - 

getConnection

com.apama.database.Connection getConnection()
Returns the connection to the database.

getId

integer getId()
Returns the messageId that was used to create the prepared query.

getPreparedQueryId

integer getPreparedQueryId()
Returns the id of the prepared query.

getQueryString

string getQueryString()
Returns the query string that was used to create the prepared query.

init

void init(com.apama.database.Connection conn, string queryString, sequence<string> inputTypes, sequence<string> outputTypes)
Initialize the prepared query elements with the query string, input and output types.
Parameters:
conn - The database connection.
queryString - The SQL query string.
inputTypes - Optional, if using replaceable parameters you need to specify the types.
outputTypes - Optional, If it will be used as a stored procedure that uses output parameters.

initPreSpawnContext

void initPreSpawnContext(context preSpawnContext)
Set context that is current prior to spawning.

Optional: Only needed when using parallel processing.
Parameters:
preSpawnContext - Current context prior to spawning.

onBeginRecovery

void onBeginRecovery()
OnBeginRecovery is called after all objects and listeners of persistent monitors have been recovered and before queued events are processed.

onConcludeRecovery

void onConcludeRecovery()
OnConcludeRecovery is called after the recovery process has been completed, including all non persistent monitors having being re-loaded.

setExtraParams

void setExtraParams(dictionary<stringstring> extra)
Additional parameters for the prepared query.
Parameters:
extra - This is currently a container to allow additional information in the future.