Package com.adaptris.core.services.jdbc
Class JdbcMapUpsert
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.jdbc.JdbcService
-
- com.adaptris.core.services.jdbc.JdbcMapInsert
-
- com.adaptris.core.services.jdbc.JdbcMapUpsert
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConnectedService
,MessageEventGenerator
,Service
,StateManagedComponent
public abstract class JdbcMapUpsert extends JdbcMapInsert
Base behaviour for upserting objects directly into a db.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
JdbcMapUpsert.SelectWrapper
class
JdbcMapUpsert.UpdateWrapper
-
Nested classes/interfaces inherited from class com.adaptris.core.services.jdbc.JdbcMapInsert
JdbcMapInsert.BasicType, JdbcMapInsert.InsertWrapper, JdbcMapInsert.StatementParam, JdbcMapInsert.StatementWrapper
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_ID_FIELD
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description JdbcMapUpsert()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getIdField()
protected int
handleUpsert(java.lang.String tablename, java.sql.Connection conn, java.util.Map<java.lang.String,java.lang.String> object)
protected java.lang.String
idField()
void
setIdField(java.lang.String elem)
<T extends JdbcMapUpsert>
TwithId(java.lang.String elem)
-
Methods inherited from class com.adaptris.core.services.jdbc.JdbcMapInsert
addUpdatedMetadata, buildStatementParam, closeJdbcService, columnBookend, getColumnBookendCharacter, getFieldMappings, getRowsAffectedMetadataKey, getTable, handleInsert, initJdbcService, prepareService, setColumnBookendCharacter, setFieldMappings, setRowsAffectedMetadataKey, setTable, startService, stopService, table, withColumnBookend, withMappings, withRowsAffectedMetadataKey, withTable
-
Methods inherited from class com.adaptris.core.jdbc.JdbcService
applyTimeout, closeService, createStatement, getConnection, getConnection, getStatementTimeout, initService, prepare, prepareStatement, prepareStatement, setConnection, setStatementTimeout, start, stop
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, doService, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Field Detail
-
DEFAULT_ID_FIELD
public static final java.lang.String DEFAULT_ID_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIdField
public java.lang.String getIdField()
- Returns:
- the idPath
-
setIdField
public void setIdField(java.lang.String elem)
- Parameters:
elem
- the field that is the ID, defaults toid
if not specified.
-
withId
public <T extends JdbcMapUpsert> T withId(java.lang.String elem)
-
idField
protected java.lang.String idField()
-
handleUpsert
protected int handleUpsert(java.lang.String tablename, java.sql.Connection conn, java.util.Map<java.lang.String,java.lang.String> object) throws ServiceException
- Throws:
ServiceException
-
-