|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dasein.persist.Execution
public abstract class Execution
Represents a database event, generally a specific query or update.
You implement this class for all statements you wish to manage.
Last modified: $Date: 2006/08/23 14:59:27 $
| Field Summary | |
|---|---|
Connection |
connection
The connection to be used for the execution of this event. |
Map<String,Object> |
data
The data to be used for the execution of this event. |
String |
dsn
|
static String |
PROPERTIES
|
ResultSet |
results
The JDBC results from the execution of this event. |
PreparedStatement |
statement
The prepared statement that will execute the event. |
| Constructor Summary | |
|---|---|
Execution()
|
|
| Method Summary | ||
|---|---|---|
void |
close()
Closes out the event and returns it to the shared stack. |
|
HashMap<String,Object> |
execute(Transaction trans,
Map<String,Object> args)
Deprecated. do not make direct calls to this method |
|
Connection |
getConnection()
|
|
String |
getDataSource()
Events should implement this method to provide the name of the data source that will be used to create connections for this event. |
|
static String |
getDataSourceName(String cname)
|
|
String |
getIdentifier(String val)
|
|
String |
getIdentifier(String tbl,
String col)
|
|
static
|
getInstance(Class<T> cls)
Provides an instance of an execution object for a specific subclass. |
|
String |
getQuotes()
|
|
String |
getState()
|
|
String |
getStatement()
|
|
String |
getStatement(Connection conn)
|
|
String |
getStatement(Connection conn,
Map<String,Object> params)
|
|
boolean |
isUpperCase()
|
|
Map<String,Translator<String>> |
loadStringTranslations(Transaction xaction,
Class cls,
String id)
|
|
void |
removeStringTranslations(Transaction xaction,
Class cls,
String id)
|
|
Map<String,Object> |
run()
Deprecated. use run(Transaction, Map) |
|
Map<String,Object> |
run(Transaction xaction,
Map<String,Object> params)
|
|
void |
saveStringTranslation(Transaction xaction,
Class cls,
String id,
String attr,
Translator<String> t)
|
|
void |
saveStringTranslation(Transaction xaction,
String cname,
String id,
String attr,
Translator<String> t)
|
|
void |
setData(HashMap<String,Object> data)
Method to set the data to be used in the transaction. |
|
protected void |
setDsn(String dsn)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROPERTIES
public Connection connection
public Map<String,Object> data
public String dsn
public ResultSet results
public PreparedStatement statement
| Constructor Detail |
|---|
public Execution()
| Method Detail |
|---|
public static String getDataSourceName(String cname)
public static <T extends Execution> T getInstance(Class<T> cls)
cls - the subclass of Execution to be
retrieved
public void close()
public String getIdentifier(String val)
throws SQLException
SQLException
public String getIdentifier(String tbl,
String col)
throws SQLException
SQLException
public String getQuotes()
throws SQLException
SQLException
public HashMap<String,Object> execute(Transaction trans,
Map<String,Object> args)
throws PersistenceException
trans - the transaction contextargs - the data to be used in the event
PersistenceException - an error occurred
executing the eventpublic Connection getConnection()
public String getDataSource()
throws NamingException
NamingException - an error occurred providing
the name of the data sourcepublic final String getState()
public String getStatement()
throws SQLException
SQLException
public String getStatement(Connection conn)
throws SQLException
SQLException
public String getStatement(Connection conn,
Map<String,Object> params)
throws SQLException
SQLException
public boolean isUpperCase()
throws SQLException
SQLException
public Map<String,Translator<String>> loadStringTranslations(Transaction xaction,
Class cls,
String id)
throws PersistenceException,
SQLException
PersistenceException
SQLException
public void removeStringTranslations(Transaction xaction,
Class cls,
String id)
throws PersistenceException,
SQLException
PersistenceException
SQLException
public Map<String,Object> run()
throws PersistenceException,
SQLException
run(Transaction, Map)
PersistenceException - a non-JDBC error
occurred executing the event
SQLException - a JDBC error occurred executing the event
public Map<String,Object> run(Transaction xaction,
Map<String,Object> params)
throws PersistenceException,
SQLException
PersistenceException
SQLException
public void saveStringTranslation(Transaction xaction,
Class cls,
String id,
String attr,
Translator<String> t)
throws SQLException,
PersistenceException
SQLException
PersistenceException
public void saveStringTranslation(Transaction xaction,
String cname,
String id,
String attr,
Translator<String> t)
throws SQLException,
PersistenceException
SQLException
PersistenceExceptionpublic void setData(HashMap<String,Object> data)
data - the data to be setprotected void setDsn(String dsn)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||