@Test public void getSqlInsert() throws JAXBException, FileNotFoundException { CsvLoadType loader; CsvLoader csvLoader; loader = ObjectFactoryUtil.getLoadTypeBySrcXml(L1C).getCsv(); csvLoader = new CsvLoader(loader, new File(D1C)); assertThat(csvLoader.getSqlInsert(loader), is(SQL)); loader = ObjectFactoryUtil.getLoadTypeBySrcXml(L2C).getCsv(); csvLoader = new CsvLoader(loader, new File(D2C)); assertThat(csvLoader.getSqlInsert(loader), is(SQL)); }
public final String getSqlInsert(final CsvLoadType loader) { String query = "insert into " + loader.getTable() + " ("; String values = ") values ("; for (Column column : loader.getColumn()) { if (BooleanUtils.isNotTrue(column.isSkip())) { query += column.getName() + ","; values += "?,"; } } return StringUtils.removeEnd(query, ",") + StringUtils.removeEnd(values, ",") + ")"; }
CsvLoader extends Loader { public final String getSqlInsert(final CsvLoadType loader) { String query = "insert into " + loader.getTable() + " ("; String values = ") values ("; for (Column column : loader.getColumn()) { if (BooleanUtils.isNotTrue(column.isSkip())) { query += column.getName() + ","; values += "?,"; } } return StringUtils.removeEnd(query, ",") + StringUtils.removeEnd(values, ",") + ")"; } }
CsvLoader extends Loader { public final String getSqlInsert(final CsvLoadType loader) { String query = "insert into " + loader.getTable() + " ("; String values = ") values ("; for (Column column : loader.getColumn()) { if (BooleanUtils.isNotTrue(column.isSkip())) { query += column.getName() + ","; values += "?,"; } } return StringUtils.removeEnd(query, ",") + StringUtils.removeEnd(values, ",") + ")"; } @SuppressWarnings({ "rawtypes", "unchecked" })  CsvLoader(final CsvLoadType loader, final File file); }
CsvLoader extends Loader { public final String getSqlInsert(final CsvLoadType loader) { String query = "insert into " + loader.getTable() + " ("; String values = ") values ("; for (Column column : loader.getColumn()) { if (BooleanUtils.isNotTrue(column.isSkip())) { query += column.getName() + ","; values += "?,"; } } return StringUtils.removeEnd(query, ",") + StringUtils.removeEnd(values, ",") + ")"; } @SuppressWarnings({ "rawtypes", "unchecked" })  CsvLoader(final CsvLoadType loader, final File file); final String getSqlInsert(final CsvLoadType loader); @Override final void dataInsert(final JdlConnection jdlConnection); }
CsvLoader extends Loader { public final String getSqlInsert(final CsvLoadType loader) { String query = "insert into " + loader.getTable() + " ("; String values = ") values ("; for (Column column : loader.getColumn()) { if (BooleanUtils.isNotTrue(column.isSkip())) { query += column.getName() + ","; values += "?,"; } } return StringUtils.removeEnd(query, ",") + StringUtils.removeEnd(values, ",") + ")"; } @SuppressWarnings({ "rawtypes", "unchecked" })  CsvLoader(final CsvLoadType loader, final File file); final String getSqlInsert(final CsvLoadType loader); @Override final void dataInsert(final JdlConnection jdlConnection);  }