use of org.apache.cayenne.dbsync.reverse.dbload.DbLoader in project cayenne by apache.
the class MergeCase method createMergeTokens.
protected List<MergerToken> createMergeTokens(String tableFilterInclude) {
FiltersConfig filters = FiltersConfig.create(null, null, TableFilter.include(tableFilterInclude), PatternFilter.INCLUDE_NOTHING);
DbLoaderConfiguration loaderConfiguration = new DbLoaderConfiguration();
loaderConfiguration.setFiltersConfig(filters);
DataMap dbImport;
try (Connection conn = node.getDataSource().getConnection()) {
dbImport = new DbLoader(node.getAdapter(), conn, loaderConfiguration, new LoggingDbLoaderDelegate(LoggerFactory.getLogger(DbLoader.class)), new DefaultObjectNameGenerator(NoStemStemmer.getInstance())).load();
} catch (SQLException e) {
throw new CayenneRuntimeException("Can't doLoad dataMap from db.", e);
}
List<MergerToken> tokens = merger().filters(filters).build().createMergeTokens(map, dbImport);
return filter(tokens);
}
Aggregations