public interface FileImportHandler<T extends Persistent>
Modifier and Type | Method and Description |
---|---|
default void |
afterImport(Map<String,Object> m,
T o)
called after importing a row
|
default boolean |
beforeImport(Map<String,Object> m,
Map<String,Object> ext)
called after reading a row
|
default boolean |
beforeInsert(Map<String,Object> m,
T o) |
default boolean |
beforeUpdate(Map<String,Object> m,
T o) |
default Persistent |
getExistingObject(Object key,
Map<String,Object> values,
Map<Object,T> cache)
should return the corresponding
Persistent object for the current
data row. |
default Object |
getKey(Map<String,Object> map)
will be called if the keyField property isn't set
|
default Object |
getKey(T o)
will be called if the keyField property isn't set
|
default String |
importCompleted()
Called after import is done.
|
default void |
init(ImportContext ctx)
called before any work starts
|
default void |
prepareFile(File f)
use this if you want to modify the file first
|
default void init(ImportContext ctx)
ctx
- contains information about the current contextdefault boolean beforeInsert(Map<String,Object> m, T o)
m
- the map with all the datao
- the object which will be insertedtrue
if object should be inserted, false
otherwisedefault boolean beforeUpdate(Map<String,Object> m, T o)
m
- the map with all the datao
- the object which will be updatedtrue
if object should be updated, false
otherwisedefault Object getKey(Map<String,Object> map)
map
- the map with all the datadefault Object getKey(T o)
o
- the objectdefault boolean beforeImport(Map<String,Object> m, Map<String,Object> ext)
m
- the data for this rowext
- the extended datatrue
if import should continue, false
otherwisedefault void afterImport(Map<String,Object> m, T o)
m
- the data mapo
- the imported objectdefault void prepareFile(File f)
f
- the filedefault Persistent getExistingObject(Object key, Map<String,Object> values, Map<Object,T> cache)
Persistent
object for the current
data row.key
- the key for the object either from keyField
or getKey(Map)
values
- the values of the current rowcache
- the cached targetClass
-objectsdefault String importCompleted()
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.