|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.midao.jdbc.core.handlers.model.QueryParameters
public class QueryParameters
Class which is responsible for values transferring in and out from QueryRunner.
Currently is used as parameters for query and storing query execution output.
Some of the functions might be moved into QueryParametersUtils to make this close clean model.
By default Key is case insensitive. If needed to make instance case sensitive please use setCaseSensitive(boolean)
Nested Class Summary | |
---|---|
static class |
QueryParameters.Direction
Parameter Direction enumeration. |
Constructor Summary | |
---|---|
QueryParameters()
Creates new QueryParameters instance |
|
QueryParameters(java.lang.Class<?> clazz,
java.lang.Object bean)
Creates new QueryParameters instance and fills it with values from Bean Only values would be imported. |
|
QueryParameters(java.util.Map<java.lang.String,java.lang.Object> map)
Creates new QueryParameters instance and fills it with values from Map Only values would be imported. |
|
QueryParameters(java.lang.Object... params)
Creates new QueryParameters instance and fills it with data from @params Only values would be set. |
|
QueryParameters(ProcessedInput processedInput)
Creates new QueryParameters instance and fills it with data from ProcessedInput Values and position. |
|
QueryParameters(QueryParameters parameters)
Creates new QueryParameters instance and fills it with data from @parameters |
Method Summary | |
---|---|
void |
assertIncorrectOrder()
Utility function. |
boolean |
containsKey(java.lang.String key)
Checks if this instance of QueryParameters contains specified Key. |
QueryParameters.Direction |
getDirection(java.lang.String key)
Returns direction of specified key |
java.lang.String |
getNameByPosition(java.lang.Integer position)
Returns Key by searching key assigned to that position |
java.lang.Integer |
getPosition(java.lang.String key)
Returns position of specified key |
java.lang.Object |
getReturn()
Utility function. |
java.lang.Integer |
getType(java.lang.String key)
Returns type of specified key |
java.lang.Object |
getValue(java.lang.String key)
Returns value of specified key |
java.lang.Object |
getValueByPosition(java.lang.Integer position)
Returns value by searching key assigned to that position |
java.lang.Object[] |
getValuesArray()
Utility function. |
void |
importValues(java.util.Map<java.lang.String,java.lang.Object> map)
Imports values from Map. |
boolean |
isCaseSensitive()
Returns if current instance has case sensitivity set for Keys |
boolean |
isInParameter(java.lang.String key)
Checks is specified key is IN parameter. |
boolean |
isOrderSet()
Utility function. |
boolean |
isOutParameter(java.lang.String key)
Checks is specified key is OUT parameter. |
java.util.Set<java.lang.String> |
keySet()
Returns key set |
void |
remove(java.lang.String key)
Removes specified key |
void |
removeReturn()
Utility function. |
QueryParameters |
set(java.lang.String key,
java.lang.Object value)
Setter function of QueryParameters |
QueryParameters |
set(java.lang.String key,
java.lang.Object value,
java.lang.Integer type)
Setter function of QueryParameters |
QueryParameters |
set(java.lang.String key,
java.lang.Object value,
java.lang.Integer type,
QueryParameters.Direction direction)
Setter function of QueryParameters |
QueryParameters |
set(java.lang.String key,
java.lang.Object value,
java.lang.Integer type,
QueryParameters.Direction direction,
java.lang.Integer position)
Setter function of QueryParameters |
QueryParameters |
set(java.lang.String key,
java.lang.Object value,
QueryParameters.Direction direction)
Setter function of QueryParameters |
void |
setCaseSensitive(boolean newValue)
Turns on/off case sensitivity for Keys |
QueryParameters |
setClassName(java.lang.String className)
Useful in cases if QueryParameter was constructed from Bean and we need to save class name |
void |
setReturn(java.lang.Object queryOutput)
Utility function. |
int |
size()
Returns amount of elements(values) set into this QueryParameter instance |
java.util.Map<java.lang.String,java.lang.Object> |
toMap()
Returns values converted to Map |
java.lang.String |
toString()
|
void |
update(java.lang.Object[] newValues,
boolean updateOutOnly)
Utility function. |
void |
updateAndClean(ProcessedInput processedInput)
Utility function. |
QueryParameters |
updateDirection(java.lang.String key,
QueryParameters.Direction direction)
Updates direction of specified key |
QueryParameters |
updatePosition(java.lang.String key,
java.lang.Integer position)
Updates position of specified key |
QueryParameters |
updateType(java.lang.String key,
java.lang.Integer type)
Updates type of specified key |
QueryParameters |
updateValue(java.lang.String key,
java.lang.Object value)
Updates value of specified key |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QueryParameters()
public QueryParameters(java.util.Map<java.lang.String,java.lang.Object> map)
map
- source of values for new QueryParameterspublic QueryParameters(java.lang.Class<?> clazz, java.lang.Object bean)
clazz
- Bean object description classbean
- source of values for new QueryParameterspublic QueryParameters(QueryParameters parameters)
parameters
- QueryParameters object which would be "cloned"public QueryParameters(ProcessedInput processedInput)
processedInput
- ProcessedInput object which would be used readpublic QueryParameters(java.lang.Object... params)
params
- "array" of values which would be used to fill new InstanceMethod Detail |
---|
public void importValues(java.util.Map<java.lang.String,java.lang.Object> map)
map
- Map which would be importedpublic QueryParameters set(java.lang.String key, java.lang.Object value, java.lang.Integer type, QueryParameters.Direction direction, java.lang.Integer position)
key
- Keyvalue
- Valuetype
- SQL Typedirection
- Direction (used for Stored Procedures calls)position
- Position of parameter in Query
public QueryParameters set(java.lang.String key, java.lang.Object value, java.lang.Integer type, QueryParameters.Direction direction)
key
- Keyvalue
- Valuetype
- SQL Typedirection
- Direction (used for Stored Procedures calls)
public QueryParameters set(java.lang.String key, java.lang.Object value, QueryParameters.Direction direction)
key
- Keyvalue
- Valuedirection
- Direction (used for Stored Procedures calls)
public QueryParameters set(java.lang.String key, java.lang.Object value, java.lang.Integer type)
key
- Keyvalue
- Valuetype
- SQL Type
public QueryParameters set(java.lang.String key, java.lang.Object value)
key
- Keyvalue
- Value
public QueryParameters setClassName(java.lang.String className)
className
- Class name
public QueryParameters updateType(java.lang.String key, java.lang.Integer type)
key
- Keytype
- SQL Type
public QueryParameters updateDirection(java.lang.String key, QueryParameters.Direction direction)
key
- Keydirection
- Direction
public QueryParameters updatePosition(java.lang.String key, java.lang.Integer position)
key
- Keyposition
- Position
public QueryParameters updateValue(java.lang.String key, java.lang.Object value)
key
- Keyvalue
- Value
public java.lang.Integer getPosition(java.lang.String key)
key
- Key
public QueryParameters.Direction getDirection(java.lang.String key)
key
- Key
public java.lang.Integer getType(java.lang.String key)
key
- Key
public java.lang.Object getValue(java.lang.String key)
key
- Key
public java.util.Map<java.lang.String,java.lang.Object> toMap()
public java.util.Set<java.lang.String> keySet()
public boolean isOutParameter(java.lang.String key)
key
- Key
public boolean isInParameter(java.lang.String key)
key
- Key
public java.lang.String getNameByPosition(java.lang.Integer position)
position
- Position which would be searched
public java.lang.Object getValueByPosition(java.lang.Integer position) throws java.lang.NoSuchFieldException
position
- Position which would be searched
java.lang.NoSuchFieldException
public boolean containsKey(java.lang.String key)
key
- Key
public void remove(java.lang.String key)
key
- Key which would be removedpublic int size()
public void setCaseSensitive(boolean newValue)
newValue
- new valuepublic boolean isCaseSensitive()
public void setReturn(java.lang.Object queryOutput)
queryOutput
- Query outputpublic java.lang.Object getReturn()
public void removeReturn()
public void update(java.lang.Object[] newValues, boolean updateOutOnly)
newValues
- array of updated valuesupdateOutOnly
- check if update OUT/INOUT parameters onlypublic void updateAndClean(ProcessedInput processedInput)
updateValue(String, Object)
All keys which are present in this instance but not present in Processed Input - would be removed.
processedInput
- Processed Input which would be used to update this instancepublic java.lang.Object[] getValuesArray()
public boolean isOrderSet()
public void assertIncorrectOrder()
isOrderSet()
Throws exception if order is incorrect
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |