|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.db.DBObject
org.apache.empire.db.DBExpr
org.apache.empire.db.DBCmdParam
public class DBCmdParam
This class defines a parameter for a prepared statement query. Do not create instances of this class yourself, rather use DBCommand.addParam(...)
Field Summary | |
---|---|
protected DBCommand |
cmd
|
protected DataType |
type
|
protected Object |
value
|
Fields inherited from class org.apache.empire.db.DBExpr |
---|
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESES, CTX_VALUE |
Constructor Summary | |
---|---|
protected |
DBCmdParam(DBCommand cmd,
DataType type,
Object value)
Protected constructor used e.g. |
Method Summary | |
---|---|
void |
addReferencedColumns(Set<DBColumn> list)
Internal function to obtain all DBColumnExpr-objects used by this expression. |
void |
addSQL(StringBuilder buf,
long context)
Used to build the SQL command. |
protected Object |
getCmdParamValue(Object value)
Returns the internal parameter value for a given "real" value. |
DBDatabase |
getDatabase()
Returns the database object to which this object belongs to. |
DataType |
getDataType()
Returns the data type of the command parameter |
Object |
getValue()
Returns the current value of the parameter. |
void |
setValue(Object value)
Sets the current value of the parameter |
Methods inherited from class org.apache.empire.db.DBExpr |
---|
getObjectValue, getValueClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DBCommand cmd
protected DataType type
protected Object value
Constructor Detail |
---|
protected DBCmdParam(DBCommand cmd, DataType type, Object value)
cmd
- the command to which this DBCommand belongs totype
- the parameter data typevalue
- the initial value (can be changed any time by calling setValue(...))Method Detail |
---|
protected Object getCmdParamValue(Object value)
the
- "real" value
public void addSQL(StringBuilder buf, long context)
DBExpr
addSQL
in class DBExpr
buf
- the string buffer used to build the sql commandcontext
- context flag for this SQL-Command (see CTX_??? constants).public void addReferencedColumns(Set<DBColumn> list)
DBExpr
addReferencedColumns
in class DBExpr
list
- list to which all used column expressions must be addedDBExpr.addReferencedColumns(Set)
public DBDatabase getDatabase()
DBObject
getDatabase
in class DBObject
public DataType getDataType()
public Object getValue()
public void setValue(Object value)
value
- the new value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |