public class RepositoryRecordWriter<T extends Model<?>> extends Object implements RecordWriter<T>
RecordWriter, that writes all records directly to the database
using a RepositoryOperations implementation. Can be configured to write using an
insert, update, or upsert (save) operation.| Modifier and Type | Class and Description |
|---|---|
static class |
RepositoryRecordWriter.WriteMode |
| Constructor and Description |
|---|
RepositoryRecordWriter(RepositoryOperations<T,?> repository) |
RepositoryRecordWriter(RepositoryOperations<T,?> repository,
RepositoryRecordWriter.WriteMode writeMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
doAfter(Object... args)
To be executed after the main component method is called for the last time.
|
void |
doBefore(Object... args)
To be executed before the main component method is first called.
|
RepositoryOperations<T,?> |
getRepository() |
void |
writeRecord(T entity)
Writes the input
Model record to the target RepositoryOperations implementation,
using the appropriate operation. |
public RepositoryRecordWriter(RepositoryOperations<T,?> repository)
public RepositoryRecordWriter(RepositoryOperations<T,?> repository, RepositoryRecordWriter.WriteMode writeMode)
public void writeRecord(T entity) throws DataImportException
Model record to the target RepositoryOperations implementation,
using the appropriate operation.writeRecord in interface RecordWriter<T extends Model<?>>entity - DataImportExceptionpublic RepositoryOperations<T,?> getRepository()
public void doBefore(Object... args) throws DataImportException
doBefore in interface DataImportComponentargs - an array of objects of any type.DataImportExceptionpublic void doAfter(Object... args) throws DataImportException
doAfter in interface DataImportComponentargs - an array of objects of any type.DataImportExceptionCopyright © 2016. All rights reserved.