org.deegree.commons.jdbc
Class TransactionRow

java.lang.Object
  extended by org.deegree.commons.jdbc.TransactionRow
Direct Known Subclasses:
InsertRow, UpdateRow

public abstract class TransactionRow
extends Object

Encapsulates columns and values for manipulating one row in a database.

Version:
$Revision: $, $Date: $
Author:
Lyn Goltz, last edited by: $Author: lyn $

Field Summary
protected  LinkedHashMap<String,String> columnToLiteral
           
protected  LinkedHashMap<String,Object> columnToObject
           
protected  QTableName table
           
 
Constructor Summary
TransactionRow(QTableName table)
           
 
Method Summary
 void addLiteralValue(String column, String literal)
           
 void addPreparedArgument(String column, Object value)
           
 void addPreparedArgument(String column, Object value, String literal)
          Use this method for example to manipulate a geometry: (#addPreparedArgument("geom", geomAsWKB, "SetSRID(GeomFromWKB(?)"))
<T extends TypedObjectNode>
void
addPreparedArgument(String column, T particle, ParticleConverter<T> converter)
           
 Object get(String column)
           
 Collection<String> getColumns()
           
abstract  String getSql()
           
 QTableName getTable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected QTableName table

columnToLiteral

protected final LinkedHashMap<String,String> columnToLiteral

columnToObject

protected final LinkedHashMap<String,Object> columnToObject
Constructor Detail

TransactionRow

public TransactionRow(QTableName table)
Parameters:
table - table targeted by the transaction, must not be null
Method Detail

getTable

public QTableName getTable()
Returns:
the table targeted for the transaction

addLiteralValue

public void addLiteralValue(String column,
                            String literal)
Parameters:
column - the name of the column, must not be null
literal - a string literal to add as value

addPreparedArgument

public void addPreparedArgument(String column,
                                Object value)
Parameters:
column - the name of the column, must not be null
value - the value to append, can be null

addPreparedArgument

public void addPreparedArgument(String column,
                                Object value,
                                String literal)
Use this method for example to manipulate a geometry: (#addPreparedArgument("geom", geomAsWKB, "SetSRID(GeomFromWKB(?)"))

Parameters:
column - the name of the column, must not be null
value - the value to append, can be null
literal - the string literal to append to the list of values, must not be null

addPreparedArgument

public <T extends TypedObjectNode> void addPreparedArgument(String column,
                                                            T particle,
                                                            ParticleConverter<T> converter)

getColumns

public Collection<String> getColumns()
Returns:
all columns considered by this tranaction

get

public Object get(String column)
Parameters:
column - the name of the column, must not be null
Returns:
the value assigned to the column with the given name, null if there is not value assigned

getSql

public abstract String getSql()
Returns:
the generated sl statement


Copyright © 2011. All Rights Reserved.