|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.objectwave.persist.sqlConstruction.SQLObject
|
+--com.objectwave.persist.sqlConstruction.SQLModifier
|
+--com.objectwave.persist.sqlConstruction.SQLInsert
A class that handles the creation of SQL Insert statements. For example:
SQLInsert sql = new SQLInsert();
sql.setTableName("TABLENAME");
com.objectwave.persist.SQLAssembler,
com.objectwave.persist.RDBBroker| Field Summary |
| Fields inherited from class com.objectwave.persist.sqlConstruction.SQLModifier |
columnList, sqlTypes, valueCount, valueList |
| Fields inherited from class com.objectwave.persist.sqlConstruction.SQLObject |
availableForPool, table |
| Constructor Summary | |
SQLInsert()
Abstract the issues with an SQL insert statement. |
|
SQLInsert(java.lang.String tableName)
|
|
| Method Summary | |
void |
bindValues(java.sql.PreparedStatement stmt,
java.lang.Class persistenceClass,
boolean verbose)
No value add other than specifying it is an INSERT statement. |
protected void |
formatColumnList(java.lang.StringBuffer buf)
The column portion of an insert statement. |
protected void |
formatTable(java.lang.StringBuffer buf)
Simply add "INTO tableName" to the provided StringBuffer. |
protected void |
formatValueList(java.lang.StringBuffer buf)
The values portion of an insert statement. |
java.lang.String |
getPreparedString()
As with the getSqlStatement() method, this method trusts that there's an ordered, 1-1 mapping between the columns list and the values list. |
java.lang.StringBuffer |
getSqlStatement()
Assemble all of the information that has been gathered into a valid sql statement. |
| Methods inherited from class com.objectwave.persist.sqlConstruction.SQLModifier |
addColumnList, addColumnValue, addValueList, bindValue, clean, copyValuesFrom, getBroker, getColumnList, getValueList, growLists, setBroker, setValues |
| Methods inherited from class com.objectwave.persist.sqlConstruction.SQLObject |
formatValue, getDefaultFormatter, getObjectFormatter, insertWhereClause, isAvailableForPool, setAvailableForPool, setObjectFormatter, setTableName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SQLInsert()
SQLObject.setTableName(String )public SQLInsert(java.lang.String tableName)
tableName - String The table name for which this statement will insert values.| Method Detail |
public void bindValues(java.sql.PreparedStatement stmt,
java.lang.Class persistenceClass,
boolean verbose)
throws java.sql.SQLException,
QueryException
bindValues in class SQLModifierstmt - java.sql.PreparedStatementpersistenceClass - The persistent class we are updating. Used for a query to determine sql types.verbose - boolean Should we be verbose about this effort?
java.sql.SQLException - An unexcepted database exception.
QueryException - An exception generated by JGrinder.protected void formatColumnList(java.lang.StringBuffer buf)
buf - StringBuffer being built that will contain the full sql statement.The user of this method.protected void formatTable(java.lang.StringBuffer buf)
buf - StringBuffer being built that will contain the full sql statement.The user of this method.protected void formatValueList(java.lang.StringBuffer buf)
buf - StringBuffer being built that will contain the full sql statement.The user of this method.public java.lang.String getPreparedString()
getPreparedString in class SQLModifierpublic java.lang.StringBuffer getSqlStatement()
getSqlStatement in interface SQLAssemblergetSqlStatement in class SQLModifier
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||