@Override public DataSource lookup(SQLDataSetDef def) throws Exception { InitialContext ctx = new InitialContext(); return (DataSource) ctx.lookup(def.getDataSource()); } @Override
@Override public DataSource lookup(SQLDataSetDef def) throws Exception { InitialContext ctx = new InitialContext(); return (DataSource) ctx.lookup(def.getDataSource()); }
@Override public DataSource lookup(SQLDataSetDef def) throws Exception { InitialContext ctx = new InitialContext(); return (DataSource) ctx.lookup(def.getDataSource()); } @Override
@Override public DataSource lookup(SQLDataSetDef def) throws Exception { InitialContext ctx = new InitialContext(); return (DataSource) ctx.lookup(def.getDataSource()); }
@Override public DataSource lookup( SQLDataSetDef def ) throws Exception { return ((AbstractDataSource) runtimeManager.lookupDataSource( def.getDataSource() ) ).getInternalDataSource(); }
.name(dataSetDef.getUUID()) .expression(((SQLDataSetDef) dataSetDef).getDbSQL()) .source(((SQLDataSetDef) dataSetDef).getDataSource()) .target(dataSetDef.getName().contains("-") ? dataSetDef.getName().substring(0, dataSetDef.getName().indexOf("-")) : "CUSTOM") .build()
.name(dataSetDef.getUUID()) .expression(((SQLDataSetDef) dataSetDef).getDbSQL()) .source(((SQLDataSetDef) dataSetDef).getDataSource()) .target(extractQueryTarget(dataSetDef)) .build()
@Override public DataSetDef clone() { SQLDataSetDef def = new SQLDataSetDef(); clone(def); def.setDataSource(getDataSource()); def.setDbSchema(getDbSchema()); def.setDbTable(getDbTable()); def.setDbSQL(getDbSQL()); return def; }
@Override public DataSetDef clone() { SQLDataSetDef def = new SQLDataSetDef(); clone(def); def.setDataSource(getDataSource()); def.setDbSchema(getDbSchema()); def.setDbTable(getDbTable()); def.setDbSQL(getDbSQL()); return def; }
public DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup) throws Exception { SQLDataSetDef sqlDef = (SQLDataSetDef) def; if (StringUtils.isBlank(sqlDef.getDataSource())) { throw new IllegalArgumentException("Missing data source in SQL data set definition: " + sqlDef);
public DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup) throws Exception { SQLDataSetDef sqlDef = (SQLDataSetDef) def; if (StringUtils.isBlank(sqlDef.getDataSource())) { throw new IllegalArgumentException("Missing data source in SQL data set definition: " + sqlDef);
@Override public void toJson(SQLDataSetDef dataSetDef, JsonObject json) { // Data source. json.put(DATA_SOURCE, dataSetDef.getDataSource()); // Schema. json.put(DB_SCHEMA, dataSetDef.getDbSchema()); // Table. if (dataSetDef.getDbTable() != null) { json.put(DB_TABLE, dataSetDef.getDbTable()); } // Query. if (dataSetDef.getDbSQL() != null) { json.put(DB_SQL, dataSetDef.getDbSQL()); } // All columns flag. json.put(ALL_COLUMNS, dataSetDef.isAllColumnsEnabled()); } }
@Override public void toJson(SQLDataSetDef dataSetDef, JsonObject json) { // Data source. json.put(DATA_SOURCE, dataSetDef.getDataSource()); // Schema. json.put(DB_SCHEMA, dataSetDef.getDbSchema()); // Table. if (dataSetDef.getDbTable() != null) { json.put(DB_TABLE, dataSetDef.getDbTable()); } // Query. if (dataSetDef.getDbSQL() != null) { json.put(DB_SQL, dataSetDef.getDbSQL()); } // All columns flag. json.put(ALL_COLUMNS, dataSetDef.isAllColumnsEnabled()); } }
private void verifyDataSetDef(DataSetDef dataSetDef) { assertEquals(DATASOURCE_UUID + SEPARATOR + SCHEMA + SEPARATOR + TABLE, dataSetDef.getUUID()); assertEquals(SCHEMA + "." + TABLE, dataSetDef.getName()); assertEquals(DATASOURCE_UUID, ((SQLDataSetDef) dataSetDef).getDataSource()); assertEquals(SCHEMA, ((SQLDataSetDef) dataSetDef).getDbSchema()); assertEquals(TABLE, ((SQLDataSetDef) dataSetDef).getDbTable()); }