|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.dataaccess.common.BatchQuery
This class is used as a builder for batch query . This class does not hold on to any database connection It is simply a helper to hold on to the batch statements Use the add method to add SQL queries Create a new instance of this class and use any one of the add statements. You can add an "update" using the first add and an insert using the second. It does not matter which one is used A word of caution DO NOT USE SELECT STATMENTS IN A BATCH QUERY AS THEY ARE NOT SUPPORTED
Constructor Summary | |
BatchQuery()
|
Method Summary | |
void |
add(BatchQuery aBatchQuery)
Add the contents of a batch query to this one. |
void |
add(Query query)
The add method can also be used as follows BatchQuery bquery = new BatchQuery(); String USERID_COLUMN = "UserId"; String USERNAME_COLUMN ="UserName"; String USER_TABLE = "User" Condition condition1 = new Condition( USERID_COLUMN, Condition.EQ, "01" ); Condition condition2 = new Condition( USERNAME_COLUMN, Condition.EQ, "Gandalf" ); condition1.and(condition2); update = new Update( USER_TABLE,condition1 ); bquery.add(update); |
void |
addMultipleStatements(String aScript)
Parse a string containing multiple statements and add to the list of statements to execute. |
void |
addStatement(String aStatement)
Add another string statement to the query. |
List |
getQueries()
Returns the queries. |
String |
toString()
Returns a String object representing this BatchQuery. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BatchQuery()
Method Detail |
public void add(Query query)
IllegalArgumentException
- if a select statement is added to the batchpublic void addMultipleStatements(String aScript)
aScript
- A string containing multiple statements delimited by ';'public void addStatement(String aStatement)
aStatement
- A string repsresenting a sql statement.public void add(BatchQuery aBatchQuery)
aBatchQuery
- the batch query to add contents from.public List getQueries()
public String toString()
toString
in class Object
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |