uk.co.kimble.cobra
Class SQLStatement
java.lang.Object
|
+--uk.co.kimble.cobra.SQLStatement
- Direct Known Subclasses:
- SQLDeleteStatement, SQLInsertStatement, SQLSelectStatement, SQLUpdateStatement
- public abstract class SQLStatement
- extends java.lang.Object
All statements are versions of SQLStatement.
|
Field Summary |
protected uk.co.kimble.cobra.ClassDictionary |
class_dictionary
|
protected java.lang.String |
sql
|
|
Constructor Summary |
SQLStatement(uk.co.kimble.cobra.ClassDictionary cd)
Constructor |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
class_dictionary
protected uk.co.kimble.cobra.ClassDictionary class_dictionary
sql
protected java.lang.String sql
SQLStatement
public SQLStatement(uk.co.kimble.cobra.ClassDictionary cd)
throws PersistentException
- Constructor
- Parameters:
cd - ClassDictionary instance
buildForObject
public abstract java.lang.String buildForObject()
throws PersistentException
- Every subclass must implement buildForObject, this method builds an SQL statment for
the object as a string. An SQL statement is mapped to a PersistentObject.
- Throws:
- PersistentException - if the class dictionary cannot be found
getClassDictionary
public uk.co.kimble.cobra.ClassDictionary getClassDictionary()
- Return the class dictionary used by this SQL statement
buildForCriteria
public java.lang.String buildForCriteria(PersistentCriteria criteria)
- Build an SQL statement for the object restricted by some criteria
- Parameters:
Criteria - to restrict SQL statement
asSQLStatement
protected java.lang.String asSQLStatement(PersistentCriteria criteria)
- Parameters:
criteria - Selection criteria
26/06/99 Change statement to a StringBuffer for efficiency
asSQLClause
protected java.lang.String asSQLClause(SelectionCriteria c)
setKeyValues
public void setKeyValues(java.sql.PreparedStatement ps,
PersistentObject po)
throws PersistentException
- Set the primary key values in a prepared statement from the values in the corresponding
persistent object attributed.
- Parameters:
ps - Prepared statementpo - Persistent object corresponding to the prepared statement- Throws:
- PersistentException - if the key values in po can't be accessed or their are no
key values to set.
setValues
public void setValues(java.sql.PreparedStatement ps,
PersistentCriteria criteria)
throws PersistentException