@Override public boolean matches(Row row) { return Objects.equals(valuePattern, columnPattern.getRowValue(row)); } };
/** * Fills in the _entryValues with the relevant info from the given "from" * table row. */ private void toEntryValues(Map<String,?> fromRow) { for(int i = 0; i < _entryValues.length; ++i) { _entryValues[i] = _fromCols.get(i).getColumn().getRowValue(fromRow); } }
/** * Fills in the _entryValues with the relevant info from the given "from" * table row. */ private void toEntryValues(Object[] fromRow) { for(int i = 0; i < _entryValues.length; ++i) { _entryValues[i] = _fromCols.get(i).getColumn().getRowValue(fromRow); } }
@Override protected AttachmentImpl toValue(ComplexValueForeignKey complexValueFk, Row rawValue) { ComplexValue.Id id = getValueId(rawValue); String url = (String)getFileUrlColumn().getRowValue(rawValue); String name = (String)getFileNameColumn().getRowValue(rawValue); String type = (String)getFileTypeColumn().getRowValue(rawValue); Integer flags = (Integer)getFileFlagsColumn().getRowValue(rawValue); Object ts = getFileTimeStampColumn().getRowValue(rawValue); byte[] data = (byte[])getFileDataColumn().getRowValue(rawValue); return new AttachmentImpl(id, complexValueFk, url, name, type, null, ts, flags, data); }
@Override protected VersionImpl toValue(ComplexValueForeignKey complexValueFk, Row rawValue) { ComplexValue.Id id = getValueId(rawValue); String value = (String)getValueColumn().getRowValue(rawValue); Object modifiedDate = getModifiedDateColumn().getRowValue(rawValue); return new VersionImpl(id, complexValueFk, value, modifiedDate); }
private static boolean areNull(Joiner joiner, Object[] row) { for(Index.Column col : joiner.getColumns()) { if(col.getColumn().getRowValue(row) != null) { return false; } } return true; }
private static boolean anyUpdates(Joiner joiner,Object[] oldRow, Object[] newRow) { Table fromTable = joiner.getFromTable(); for(Index.Column iCol : joiner.getColumns()) { Column col = iCol.getColumn(); if(!MATCHER.matches(fromTable, col.getName(), col.getRowValue(oldRow), col.getRowValue(newRow))) { return true; } } return false; }
@Override protected SingleValueImpl toValue( ComplexValueForeignKey complexValueFk, Row rawValue) { ComplexValue.Id id = getValueId(rawValue); Object value = getValueColumn().getRowValue(rawValue); return new SingleValueImpl(id, complexValueFk, value); }
protected ComplexValueIdImpl getValueId(Object[] row) { int idVal = (Integer)getPrimaryKeyColumn().getRowValue(row); return new ComplexValueIdImpl(idVal, ((TableImpl)_flatTable).getRowId(row)); }
@Override protected UnsupportedValueImpl toValue( ComplexValueForeignKey complexValueFk, Row rawValue) { ComplexValue.Id id = getValueId(rawValue); Map<String,Object> values = new LinkedHashMap<String,Object>(); for(Column col : getValueColumns()) { col.setRowValue(values, col.getRowValue(rawValue)); } return new UnsupportedValueImpl(id, complexValueFk, values); }
protected ComplexValueIdImpl getValueId(Row row) { int idVal = (Integer)getPrimaryKeyColumn().getRowValue(row); return new ComplexValueIdImpl(idVal, row.getId()); }
@Override protected Object[] asRow(Object[] row, UnsupportedValue value) throws IOException { super.asRow(row, value); Map<String,Object> values = value.getValues(); for(Column col : getValueColumns()) { col.setRowValue(row, col.getRowValue(values)); } return row; }
unfilteredRowData[i] = columns.get(i).getRowValue(row);
private static void updateSecondaryValues(Joiner joiner, Object[] oldFromRow, Object[] newFromRow) throws IOException { IndexCursor toCursor = joiner.getToCursor(); List<? extends Index.Column> fromCols = joiner.getColumns(); List<? extends Index.Column> toCols = joiner.getToIndex().getColumns(); Object[] toRow = new Object[joiner.getToTable().getColumnCount()]; for(Iterator<Row> iter = joiner.findRows(oldFromRow) .setColumnNames(Collections.<String>emptySet()) .iterator(); iter.hasNext(); ) { iter.next(); // create update row for "to" table Arrays.fill(toRow, Column.KEEP_VALUE); for(int i = 0; i < fromCols.size(); ++i) { Object val = fromCols.get(i).getColumn().getRowValue(newFromRow); toCols.get(i).getColumn().setRowValue(toRow, val); } toCursor.updateCurrentRow(toRow); } }
private void populateIndexData(IndexData idxData) throws IOException { // grab the columns involved in this index List<ColumnImpl> idxCols = new ArrayList<ColumnImpl>(); for(IndexData.ColumnDescriptor col : idxData.getColumns()) { idxCols.add(col.getColumn()); } // iterate through all the rows and add them to the index Object[] rowVals = new Object[_columns.size()]; for(Row row : getDefaultCursor().newIterable().addColumns(idxCols)) { for(Column col : idxCols) { col.setRowValue(rowVals, col.getRowValue(row)); } IndexData.commitAll( idxData.prepareAddRow(rowVals, (RowIdImpl)row.getId(), null)); } updateTableDefinition(0); }
ComplexValueForeignKey rowFk = (ComplexValueForeignKey) cl.getRowValue(cur.getCurrentRow());