public interface SynchroTableDao extends Closeable
Modifier and Type | Method and Description |
---|---|
long |
count()
Count the number of rows in the table
|
long |
countDataToUpdate(Date fromDate)
Count the number of rows updated since the given date
|
void |
deleteAll()
Delete all rows of a table
|
void |
executeInsert(Object[] row)
Insert into a table the current row of the given incoming data
Same as
#executeInsert(List,ResultSet) , but using a array instead of a ResultSet. |
void |
executeInsert(ResultSet incomingData)
Insert into a table the current row of the given
ResultSet |
Integer |
executeInsertAndReturnId(ResultSet incomingData) |
void |
executeUpdate(List<Object> pk,
Object[] row)
Update one table's row, using the current row of the given array of values
Same as
executeUpdate(List,ResultSet) , but using a array instead of a ResultSet. |
void |
executeUpdate(List<Object> pk,
ResultSet incomingData)
Update one table's row, using the current row of the given
ResultSet |
Object[] |
findByPk(List<Object> pk)
Obtains a row, using values of each PK
|
void |
flush()
Flush all pending updates (i.e. pending batch statement)
|
Connection |
getConnection() |
ResultSet |
getDataByFk(String fkColumnName,
Set<Integer> fkValues)
Getting all row depending of parent FK values
|
ResultSet |
getDataToUpdate(Date fromDate)
Obtains all data updated since the given date (or all data if the given date is null
|
Set<String> |
getExistingPrimaryKeys()
Obtains all primary keys of a table.
|
Map<Integer,Integer> |
getExistingRemoteIdsMap()
Obtains existing remoteIds
|
Integer |
getIdFromRemoteId(String tableName,
Integer remoteId)
Retrieve a id by a remote id.
|
int |
getInsertCount()
Obtains the number of inserted rows
|
Timestamp |
getLastUpdateDate()
Obtains the max update date found in table's rows
|
SynchroPendingOperationBuffer |
getPendingOperationBuffer() |
List<Object> |
getPk(ResultSet incomingData)
Obtains a PK from the current ResultSet's row
|
SynchroTableMetadata |
getTable() |
int |
getUpdateCount()
Obtains the number of updated rows
|
void |
setPendingOperationBuffer(SynchroPendingOperationBuffer pendingChangesBuffer) |
Connection getConnection()
SynchroTableMetadata getTable()
void setPendingOperationBuffer(SynchroPendingOperationBuffer pendingChangesBuffer)
SynchroPendingOperationBuffer getPendingOperationBuffer()
Timestamp getLastUpdateDate() throws SQLException
SQLException
long count() throws SQLException
SQLException
long countDataToUpdate(Date fromDate) throws SQLException
fromDate
- SQLException
Integer getIdFromRemoteId(String tableName, Integer remoteId) throws SQLException
tableName
- remoteId
- SQLException
Map<Integer,Integer> getExistingRemoteIdsMap() throws SQLException
SQLException
ResultSet getDataByFk(String fkColumnName, Set<Integer> fkValues) throws SQLException
fkColumnName
- the FK column namefkValues
- values of the FK columnsSQLException
ResultSet getDataToUpdate(Date fromDate) throws SQLException
fromDate
- SQLException
Set<String> getExistingPrimaryKeys() throws SQLException
SynchroTableMetadata.toPkStr(java.util.List<java.lang.Object>)
SQLException
Object[] findByPk(List<Object> pk) throws SQLException
pk
- values of PK columnSQLException
List<Object> getPk(ResultSet incomingData) throws SQLException
incomingData
- tableBuffer
- SQLException
void deleteAll() throws SQLException
SQLException
void executeInsert(ResultSet incomingData) throws SQLException
ResultSet
pk
- the PK of the current row (only need for logging)incomingData
- a ResultSet
with a row ready to be read (ResultSet.next()
should have been call
before)SQLException
void executeInsert(Object[] row) throws SQLException
#executeInsert(List,ResultSet)
, but using a array instead of a ResultSet.incomingData
- a array of objectSQLException
Integer executeInsertAndReturnId(ResultSet incomingData) throws SQLException
SQLException
void executeUpdate(List<Object> pk, ResultSet incomingData) throws SQLException
ResultSet
pk
- the PK of the row to updateincomingData
- a ResultSet
with a row ready to be read (ResultSet.next()
should have been call
before)SQLException
void executeUpdate(List<Object> pk, Object[] row) throws SQLException
executeUpdate(List,ResultSet)
, but using a array instead of a ResultSet.pk
- the PK of the row to updaterow
- a array of objectSQLException
void flush() throws SQLException
SQLException
int getUpdateCount()
int getInsertCount()
Copyright © 2012–2014 IFREMER. All rights reserved.