protected Object onRowCellAdd(String tableName, String columnName, Row row) { return row.get(columnName); }
if (name != null && TYPE_QUERY.equals(row.get(CAT_COL_TYPE))) { queryInfo.add(row); Integer id = row.getInt(CAT_COL_ID);
if (name != null && TYPE_RELATIONSHIP.equals(row.get(CAT_COL_TYPE))) { names.add(toLookupName(name));
private String readField (Row row , String fieldName) { Object value = row.get(fieldName); return value == null? "" : value.toString(); }
@Override public boolean matches(Row row) { for(Map.Entry<String,?> e : rowPattern.entrySet()) { if(!Objects.equals(e.getValue(), row.get(e.getKey()))) { return false; } } return true; } };
@Override public Iterable<Object> getValues() { ArrayList<Object> ret = new ArrayList<Object>(); for (Row row : _table) { ret.add(row.get(_name)); } return ret; }
private void cacheValues() { for (Row row : _table) { for (String s : row.keySet()) { _cache.put(_name + "_" + s, row.get(s)); } } } }
private boolean checkInside(Database db) throws IOException { Table t = db.getSystemTable("MSysObjects"); Iterator<Row> it = t.iterator(); while (it.hasNext()) { Row row = it.next(); Object dobj = row.get("DateUpdate"); Object tobj = row.get("Type"); if (dobj == null || tobj == null) { continue; } Date dt = (Date) dobj; short type = (Short) tobj; if (lastModified < dt.getTime() && (type == 1 || type == 5 || type == 8) ) { return true; } } return false; }
@Override public Map<String, Object> getMapping(String keyColumnName, String valueColumnName) throws KlabIOException { if (!hasMappingFor(_name, keyColumnName, valueColumnName)) { Map<String, Object> newmap = getMappingFor(_name, keyColumnName, valueColumnName); KLAB.info("caching values for mapping " + keyColumnName + " -> " + valueColumnName + " in table " + _name); for (Row row : getTable()) { Object key = row.get(keyColumnName); Object val = row.get(valueColumnName); if (key != null && val != null) { newmap.put(key.toString(), val); } } db.commit(); return newmap; } return getMappingFor(_name, keyColumnName, valueColumnName); }
public BlobKey(Table _table, String _columnName, Row _row) { this.tableName = _table.getName(); this.columnName = _columnName; if (hasPrimaryKey(_table)) { List<? extends Index.Column> cl = _table.getPrimaryKeyIndex().getColumns(); HashMap<String, Object> keyMap = new HashMap<String, Object>(); for (Index.Column c : cl) { keyMap.put(c.getName(), _row.get(c.getName())); } this.key = keyMap; } }
@Override public void loadData(List<Tuple<String, File>> files, Importer importer) throws InvalidFileException, IOException { Database database = DatabaseBuilder.open(files.get(0).getRight()); for (String tableName : database.getTableNames()) { importer.startCollection(tableName); Table table = database.getTable(tableName); List<? extends Column> columns = table.getColumns(); for (int i = 0; i < columns.size(); i++) { importer.registerPropertyName(i, columns.get(i).getName()); } for (Row row : table) { importer.startEntity(); for (int colNum = 0 ; colNum < columns.size(); colNum++) { Object cellValue = row.get(columns.get(colNum).getName()); if (cellValue == null) { cellValue = ""; } importer.setValue(colNum, "" + cellValue); } importer.finishEntity(); } importer.finishCollection(); } } }
private void readTableData(Table table) throws IOException { com.healthmarketscience.jackcess.Table sourceTable = jackcessDatabase.getTable(table.getName()); for (com.healthmarketscience.jackcess.Row sourceRow : sourceTable) { Row row = new Row(table); for (Column column : table.getColumns()) { row.add(column, sourceRow.get(column.getName())); } table.addRow(row); } }
private boolean currentRowMatchesEntryImpl(Object[] rowValues, ColumnMatcher columnMatcher) throws IOException { // check the next row to see if it actually matches Row row = getCurrentRow(getIndexEntryPattern()); for(IndexData.ColumnDescriptor col : getIndex().getColumns()) { Object patValue = rowValues[col.getColumnIndex()]; if((patValue == IndexData.MIN_VALUE) || (patValue == IndexData.MAX_VALUE)) { // all remaining entry values are "special" (used for partial lookups) return true; } String columnName = col.getName(); Object rowValue = row.get(columnName); if(!columnMatcher.matches(getTable(), columnName, patValue, rowValue)) { return false; } } return true; }