Class SqlQuery
- java.lang.Object
-
- com.aquima.interactions.foundation.connectivity.impl.SqlQuery
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SqlQuery(Connection connection, String queryStr)
protected
SqlQuery(Connection connection, String queryStr, String pk)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This method should be used to close the query once it is no longer used.IQueryResult
execute()
This method will execute the query and return an object that can be used to iterate over the results of the query.int
executeUpdate()
This method will execute the query and return the number of rows that were affected by the query.long
getIdentity()
This method returns the ID of the last inserted record (if available).void
setBoolean(boolean booleanValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setBytes(byte[] content)
Sets an object on the query after the position of the last setter call to null; Making this function order dependent.void
setDate(Date dateValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setDateTimeValue(DateTimeValue dateValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setDateValue(DateValue dateValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setDouble(double doubleValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setFloat(float floatValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setInteger(int integerValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setLong(long longValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setNull(DataType type)
Sets an object on the query after the position of the last setter call to null; Making this function order dependent.void
setParameters(List<Object> parameters)
Set multiple parameters.void
setString(String stringValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.void
setStringValue(StringValue stringValue)
Sets an object on the query after the position of the last setter call; Making this function order dependent.
-
-
-
Constructor Detail
-
SqlQuery
protected SqlQuery(Connection connection, String queryStr) throws SQLException
- Throws:
SQLException
-
SqlQuery
protected SqlQuery(Connection connection, String queryStr, String pk) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
close
public void close()
Description copied from interface:IQuery
This method should be used to close the query once it is no longer used. The close method should be invoked to release external resources claimed by the query.
-
execute
public IQueryResult execute()
Description copied from interface:IQuery
This method will execute the query and return an object that can be used to iterate over the results of the query. For update queries (insert, delete, etc...) use the executeUpdate method.
-
executeUpdate
public int executeUpdate()
Description copied from interface:IQuery
This method will execute the query and return the number of rows that were affected by the query.- Specified by:
executeUpdate
in interfaceIQuery
- Returns:
- The number of rows that were updated.
-
getIdentity
public long getIdentity()
Description copied from interface:IQuery
This method returns the ID of the last inserted record (if available).- Specified by:
getIdentity
in interfaceIQuery
- Returns:
- the ID of the last inserted record.
-
setBoolean
public void setBoolean(boolean booleanValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.- Specified by:
setBoolean
in interfaceIQuery
- Parameters:
booleanValue
- The value that should be set at the specified index.
-
setDate
public void setDate(Date dateValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.
-
setDateValue
public void setDateValue(DateValue dateValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.- Specified by:
setDateValue
in interfaceIQuery
- Parameters:
dateValue
- The value that should be set at the specified index.
-
setDateTimeValue
public void setDateTimeValue(DateTimeValue dateValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.- Specified by:
setDateTimeValue
in interfaceIQuery
- Parameters:
dateValue
- The value that should be set at the specified index.
-
setDouble
public void setDouble(double doubleValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.
-
setFloat
public void setFloat(float floatValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.
-
setInteger
public void setInteger(int integerValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.- Specified by:
setInteger
in interfaceIQuery
- Parameters:
integerValue
- The value that should be set at the specified index.
-
setLong
public void setLong(long longValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.
-
setString
public void setString(String stringValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.
-
setStringValue
public void setStringValue(StringValue stringValue)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call; Making this function order dependent.- Specified by:
setStringValue
in interfaceIQuery
- Parameters:
stringValue
- The value that should be set at the specified index.
-
setNull
public void setNull(DataType type)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call to null; Making this function order dependent.
-
setParameters
public void setParameters(List<Object> parameters)
Description copied from interface:IQuery
Set multiple parameters. The parameters list passed to this method does not have to be an uniform list of parameters. Parameters may be mixed. Note: The parameters passed to this method is an List due to the .NET conversion.- Specified by:
setParameters
in interfaceIQuery
- Parameters:
parameters
- a non-null list of parameters containing ( String, Long, Integer ... ) objects.
-
setBytes
public void setBytes(byte[] content)
Description copied from interface:IQuery
Sets an object on the query after the position of the last setter call to null; Making this function order dependent.
-
-