@IntegrationFeature(clazz=DBFeature.class, name="db") public class DBFeatureImpl extends org.adroitlogic.x.api.AbstractIntegrationFeature implements DBFeature
DBFeature
using a caching strategy.Constructor and Description |
---|
DBFeatureImpl() |
Modifier and Type | Method and Description |
---|---|
void |
init(org.springframework.context.ApplicationContext context) |
List<Map<String,Object>> |
read(DataSource dataSource,
File mappingFile,
String parameterizedSQL,
org.adroitlogic.x.api.XMessageContext xMessageContext)
Can be used for database read operations.
|
int |
update(DataSource dataSource,
File mappingFile,
String parameterizedSQL,
org.adroitlogic.x.api.XMessageContext xMessageContext)
Can be used for database insert, update and delete operations.
|
public void init(org.springframework.context.ApplicationContext context)
init
in interface org.adroitlogic.x.api.dec.Initializable
init
in class org.adroitlogic.x.api.AbstractIntegrationFeature
public int update(DataSource dataSource, File mappingFile, String parameterizedSQL, org.adroitlogic.x.api.XMessageContext xMessageContext) throws org.springframework.dao.DataAccessException
DBFeature
update
in interface DBFeature
dataSource
- DataSource
instance of the database to be used.mappingFile
- JSON configuration mapping file with the mapping between parameters and actual data.parameterizedSQL
- SQL query with parameters. Parameter should be in @{parameter-name} format.xMessageContext
- XMessageContext
which contains the payload to extract data.org.springframework.dao.DataAccessException
public List<Map<String,Object>> read(DataSource dataSource, File mappingFile, String parameterizedSQL, org.adroitlogic.x.api.XMessageContext xMessageContext) throws org.springframework.dao.DataAccessException
DBFeature
read
in interface DBFeature
dataSource
- DataSource
instance of the database to be used.mappingFile
- JSON configuration mapping file with the mapping between parameters and actual data.parameterizedSQL
- SQL query with parameters. Parameter should be in @{parameter-name} format.xMessageContext
- message context used for the database read operationorg.springframework.dao.DataAccessException
Copyright © 2016–2019 AdroitLogic. All rights reserved.