com.partnersoft.sql
Class SqlDataRecordInsertOrUpdateSink
java.lang.Object
com.partnersoft.io.DataRecordSink
com.partnersoft.sql.SqlDataRecordInsertOrUpdateSink
public class SqlDataRecordInsertOrUpdateSink
- extends DataRecordSink
DataRecordSink for inserting or updating records to an SqlDatabase.
If only inserting or updating is going to happen, use the specific
sinks. This sink will have overhead of an extra count query per
transaction.
Copyright 2009 Partner Software, Inc.
- Version:
- $Id$
- Author:
- Rich Stepanski
|
Constructor Summary |
SqlDataRecordInsertOrUpdateSink(SqlConnection connection,
java.lang.String tableName,
java.lang.String keyField,
boolean closeWhenDone,
java.util.List<java.lang.String> fieldNames)
Creates a new SqlDataRecordInsertOrUpdateSink. |
SqlDataRecordInsertOrUpdateSink(SqlConnection connection,
java.lang.String tableName,
java.lang.String keyField,
boolean closeWhenDone,
java.lang.String... fieldNames)
Creates a new SqlDataRecordInsertOrUpdateSink. |
|
Method Summary |
protected void |
closeImp()
|
protected void |
openImp()
|
protected void |
writeImp(java.util.List<java.lang.Object> payload)
|
protected void |
writeImp(Naming<java.lang.Object> payload)
|
protected void |
writeImp(java.lang.Object... payload)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SqlDataRecordInsertOrUpdateSink
public SqlDataRecordInsertOrUpdateSink(SqlConnection connection,
java.lang.String tableName,
java.lang.String keyField,
boolean closeWhenDone,
java.util.List<java.lang.String> fieldNames)
- Creates a new SqlDataRecordInsertOrUpdateSink.
- Parameters:
connection - - SqlConnection for the database to insert or update on.tableName - - name of table to insert or update.keyField - - field to count to determinecloseWhenDone - - if true, connection is closed when close is called.fieldNames - - list of names expected by write calls.
SqlDataRecordInsertOrUpdateSink
public SqlDataRecordInsertOrUpdateSink(SqlConnection connection,
java.lang.String tableName,
java.lang.String keyField,
boolean closeWhenDone,
java.lang.String... fieldNames)
- Creates a new SqlDataRecordInsertOrUpdateSink.
- Parameters:
connection - - SqlConnection for the database to insert or update on.tableName - - name of table to insert or update.keyField - - field to count to determinecloseWhenDone - - if true, connection is closed when close is called.fieldNames - - array of names expected by write calls.
closeImp
protected void closeImp()
throws java.lang.Exception
- Specified by:
closeImp in class DataRecordSink
- Throws:
java.lang.Exception
openImp
protected void openImp()
throws java.lang.Exception
- Specified by:
openImp in class DataRecordSink
- Throws:
java.lang.Exception
writeImp
protected void writeImp(Naming<java.lang.Object> payload)
throws java.lang.Exception
- Specified by:
writeImp in class DataRecordSink
- Throws:
java.lang.Exception
writeImp
protected void writeImp(java.lang.Object... payload)
throws java.lang.Exception
- Specified by:
writeImp in class DataRecordSink
- Throws:
java.lang.Exception
writeImp
protected void writeImp(java.util.List<java.lang.Object> payload)
throws java.lang.Exception
- Specified by:
writeImp in class DataRecordSink
- Throws:
java.lang.Exception