@Test public void testToParameters_MeaningfulPkTables() throws Exception { DbImportConfiguration parameters1 = getCdbImport("dbimporter-pom1.xml").createConfig(mock(Logger.class)); assertNull(parameters1.getMeaningfulPkTables()); assertPathEquals("target/test/org/apache/cayenne/tools/dbimporter-map1.map.xml", parameters1.getTargetDataMap() .getPath()); assertEquals("x,b*", getCdbImport("dbimporter-pom2.xml").createConfig(mock(Logger.class)).getMeaningfulPkTables()); assertEquals("*", getCdbImport("dbimporter-pom3.xml").createConfig(mock(Logger.class)).getMeaningfulPkTables()); }
DbImportConfiguration createConfig(final Logger logger) { DbImportConfiguration config = new DbImportConfiguration(); if (dbImportConfig.getCatalogs().size() == 0 && dbImportConfig.isEmptyContainer()) { config.setUseDataMapReverseEngineering(true); } config.setAdapter(adapter); config.setDefaultPackage(dbImportConfig.getDefaultPackage()); config.setDriver(dataSource.getDriver()); config.setForceDataMapCatalog(dbImportConfig.isForceDataMapCatalog()); config.setForceDataMapSchema(dbImportConfig.isForceDataMapSchema()); config.setLogger(logger); config.setMeaningfulPkTables(dbImportConfig.getMeaningfulPkTables()); config.setNamingStrategy(dbImportConfig.getNamingStrategy()); config.setPassword(dataSource.getPassword()); config.setSkipRelationshipsLoading(dbImportConfig.getSkipRelationshipsLoading()); config.setSkipPrimaryKeyLoading(dbImportConfig.getSkipPrimaryKeyLoading()); config.setStripFromTableNames(dbImportConfig.getStripFromTableNames()); config.setTableTypes(dbImportConfig.getTableTypes()); config.setTargetDataMap(map); config.setCayenneProject(cayenneProject); config.setUrl(dataSource.getUrl()); config.setUsername(dataSource.getUsername()); config.setUsePrimitives(dbImportConfig.isUsePrimitives()); config.setUseJava7Types(dbImportConfig.isUseJava7Types()); return config; }
DbImporterMojo extends AbstractMojo { DbImportConfiguration createConfig(final Logger logger) { DbImportConfiguration config = new DbImportConfiguration(); if (dbImportConfig.getCatalogs().size() == 0 && dbImportConfig.isEmptyContainer()) { config.setUseDataMapReverseEngineering(true); } config.setAdapter(adapter); config.setDefaultPackage(dbImportConfig.getDefaultPackage()); config.setDriver(dataSource.getDriver()); config.setForceDataMapCatalog(dbImportConfig.isForceDataMapCatalog()); config.setForceDataMapSchema(dbImportConfig.isForceDataMapSchema()); config.setLogger(logger); config.setMeaningfulPkTables(dbImportConfig.getMeaningfulPkTables()); config.setNamingStrategy(dbImportConfig.getNamingStrategy()); config.setPassword(dataSource.getPassword()); config.setSkipRelationshipsLoading(dbImportConfig.getSkipRelationshipsLoading()); config.setSkipPrimaryKeyLoading(dbImportConfig.getSkipPrimaryKeyLoading()); config.setStripFromTableNames(dbImportConfig.getStripFromTableNames()); config.setTableTypes(dbImportConfig.getTableTypes()); config.setTargetDataMap(map); config.setCayenneProject(cayenneProject); config.setUrl(dataSource.getUrl()); config.setUsername(dataSource.getUsername()); config.setUsePrimitives(dbImportConfig.isUsePrimitives()); config.setUseJava7Types(dbImportConfig.isUseJava7Types()); return config; } }
DbImporterMojo extends AbstractMojo { DbImportConfiguration createConfig(final Logger logger) { DbImportConfiguration config = new DbImportConfiguration(); if (dbImportConfig.getCatalogs().size() == 0 && dbImportConfig.isEmptyContainer()) { config.setUseDataMapReverseEngineering(true); } config.setAdapter(adapter); config.setDefaultPackage(dbImportConfig.getDefaultPackage()); config.setDriver(dataSource.getDriver()); config.setForceDataMapCatalog(dbImportConfig.isForceDataMapCatalog()); config.setForceDataMapSchema(dbImportConfig.isForceDataMapSchema()); config.setLogger(logger); config.setMeaningfulPkTables(dbImportConfig.getMeaningfulPkTables()); config.setNamingStrategy(dbImportConfig.getNamingStrategy()); config.setPassword(dataSource.getPassword()); config.setSkipRelationshipsLoading(dbImportConfig.getSkipRelationshipsLoading()); config.setSkipPrimaryKeyLoading(dbImportConfig.getSkipPrimaryKeyLoading()); config.setStripFromTableNames(dbImportConfig.getStripFromTableNames()); config.setTableTypes(dbImportConfig.getTableTypes()); config.setTargetDataMap(map); config.setCayenneProject(cayenneProject); config.setUrl(dataSource.getUrl()); config.setUsername(dataSource.getUsername()); config.setUsePrimitives(dbImportConfig.isUsePrimitives()); config.setUseJava7Types(dbImportConfig.isUseJava7Types()); return config; }  }
DbImporterMojo extends AbstractMojo { DbImportConfiguration createConfig(final Logger logger) { DbImportConfiguration config = new DbImportConfiguration(); if (dbImportConfig.getCatalogs().size() == 0 && dbImportConfig.isEmptyContainer()) { config.setUseDataMapReverseEngineering(true); } config.setAdapter(adapter); config.setDefaultPackage(dbImportConfig.getDefaultPackage()); config.setDriver(dataSource.getDriver()); config.setForceDataMapCatalog(dbImportConfig.isForceDataMapCatalog()); config.setForceDataMapSchema(dbImportConfig.isForceDataMapSchema()); config.setLogger(logger); config.setMeaningfulPkTables(dbImportConfig.getMeaningfulPkTables()); config.setNamingStrategy(dbImportConfig.getNamingStrategy()); config.setPassword(dataSource.getPassword()); config.setSkipRelationshipsLoading(dbImportConfig.getSkipRelationshipsLoading()); config.setSkipPrimaryKeyLoading(dbImportConfig.getSkipPrimaryKeyLoading()); config.setStripFromTableNames(dbImportConfig.getStripFromTableNames()); config.setTableTypes(dbImportConfig.getTableTypes()); config.setTargetDataMap(map); config.setCayenneProject(cayenneProject); config.setUrl(dataSource.getUrl()); config.setUsername(dataSource.getUsername()); config.setUsePrimitives(dbImportConfig.isUsePrimitives()); config.setUseJava7Types(dbImportConfig.isUseJava7Types()); return config; }  void execute(); File getMap(); void setMap(final File map); void setDbimport(final ReverseEngineering dbImportConfig); void setDbImport(final ReverseEngineering dbImportConfig); ReverseEngineering getReverseEngineering(); DbImportDataSourceConfig getDataSource(); }
DbImporterMojo extends AbstractMojo { DbImportConfiguration createConfig(final Logger logger) { DbImportConfiguration config = new DbImportConfiguration(); if (dbImportConfig.getCatalogs().size() == 0 && dbImportConfig.isEmptyContainer()) { config.setUseDataMapReverseEngineering(true); } config.setAdapter(adapter); config.setDefaultPackage(dbImportConfig.getDefaultPackage()); config.setDriver(dataSource.getDriver()); config.setForceDataMapCatalog(dbImportConfig.isForceDataMapCatalog()); config.setForceDataMapSchema(dbImportConfig.isForceDataMapSchema()); config.setLogger(logger); config.setMeaningfulPkTables(dbImportConfig.getMeaningfulPkTables()); config.setNamingStrategy(dbImportConfig.getNamingStrategy()); config.setPassword(dataSource.getPassword()); config.setSkipRelationshipsLoading(dbImportConfig.getSkipRelationshipsLoading()); config.setSkipPrimaryKeyLoading(dbImportConfig.getSkipPrimaryKeyLoading()); config.setStripFromTableNames(dbImportConfig.getStripFromTableNames()); config.setTableTypes(dbImportConfig.getTableTypes()); config.setTargetDataMap(map); config.setCayenneProject(cayenneProject); config.setUrl(dataSource.getUrl()); config.setUsername(dataSource.getUsername()); config.setUsePrimitives(dbImportConfig.isUsePrimitives()); config.setUseJava7Types(dbImportConfig.isUseJava7Types()); return config; }  void execute(); File getMap(); void setMap(final File map); void setDbimport(final ReverseEngineering dbImportConfig); void setDbImport(final ReverseEngineering dbImportConfig); ReverseEngineering getReverseEngineering(); DbImportDataSourceConfig getDataSource();  }