protected Object onRowCellAdd(String tableName, String columnName, Row row) { return row.get(columnName); }
public com.healthmarketscience.jackcess.Row toTableRow() { com.healthmarketscience.jackcess.Row tableRow = new RowImpl((RowIdImpl)_id); tableRow.put(COL_ATTRIBUTE, attribute); tableRow.put(COL_EXPRESSION, expression); tableRow.put(COL_FLAG, flag); tableRow.put(COL_EXTRA, extra); tableRow.put(COL_NAME1, name1); tableRow.put(COL_NAME2, name2); tableRow.put(COL_OBJECTID, objectId); tableRow.put(COL_ORDER, order); return tableRow; }
public Row(com.healthmarketscience.jackcess.Row tableRow) { this(tableRow.getId(), tableRow.getByte(COL_ATTRIBUTE), tableRow.getString(COL_EXPRESSION), tableRow.getShort(COL_FLAG), tableRow.getInt(COL_EXTRA), tableRow.getString(COL_NAME1), tableRow.getString(COL_NAME2), tableRow.getInt(COL_OBJECTID), tableRow.getBytes(COL_ORDER)); }
@Override public TableInfo lookupTable(String tableName) throws IOException { if(findRow(_tableParentId, tableName) == null) { return null; } Row row = _systemCatalogCursor.getCurrentRow( SYSTEM_CATALOG_TABLE_DETAIL_COLUMNS); Integer pageNumber = row.getInt(CAT_COL_ID); String realName = row.getString(CAT_COL_NAME); int flags = row.getInt(CAT_COL_FLAGS); Short type = row.getShort(CAT_COL_TYPE); if(!isTableType(type)) { return null; } String linkedDbName = row.getString(CAT_COL_DATABASE); String linkedTableName = row.getString(CAT_COL_FOREIGN_NAME); return createTableInfo(realName, pageNumber, flags, type, linkedDbName, linkedTableName); }
SYSTEM_CATALOG_COLUMNS)) String name = row.getString(CAT_COL_NAME); if (name != null && TYPE_QUERY.equals(row.get(CAT_COL_TYPE))) { queryInfo.add(row); Integer id = row.getInt(CAT_COL_ID); queryRowMap.put(id, new ArrayList<QueryImpl.Row>()); String name = row.getString(CAT_COL_NAME); Integer id = row.getInt(CAT_COL_ID); int flags = row.getInt(CAT_COL_FLAGS); List<QueryImpl.Row> queryRows = queryRowMap.get(id); queries.add(QueryImpl.create(flags, name, queryRows, id));
private PropertyMaps readProperties(int objectId, Row objectRow, PropertyMaps.Owner owner) throws IOException { byte[] propsBytes = null; RowIdImpl rowId = null; if(objectRow != null) { propsBytes = objectRow.getBytes(CAT_COL_PROPS); objectId = objectRow.getInt(CAT_COL_ID); rowId = (RowIdImpl)objectRow.getId(); } return getPropsHandler().read(propsBytes, objectId, rowId, owner); }
/** * Find collection of SIDs for the given parent id. */ private void collectNewObjectSIDs(Integer parentId, List<byte[]> sids) throws IOException { // search for ACEs matching the given parentId. use the index on the // objectId column if found (should be there) Cursor cursor = createCursorWithOptionalIndex( getAccessControlEntries(), ACE_COL_OBJECT_ID, parentId); for(Row row : cursor) { Integer objId = row.getInt(ACE_COL_OBJECT_ID); if(parentId.equals(objId)) { sids.add(row.getBytes(ACE_COL_SID)); } } if(sids.isEmpty()) { // if all else fails, use the hard-coded default sids.add(SYS_DEFAULT_SID); } }
/** * @param tableDefPageNumber the page number of a table definition * @return The table, or null if it doesn't exist * @usage _advanced_method_ */ public TableImpl getTable(int tableDefPageNumber) throws IOException { // first, check for existing table TableImpl table = _tableCache.get(tableDefPageNumber); if(table != null) { return table; } // lookup table info from system catalog Row objectRow = _tableFinder.getObjectRow( tableDefPageNumber, SYSTEM_CATALOG_COLUMNS); if(objectRow == null) { return null; } String name = objectRow.getString(CAT_COL_NAME); int flags = objectRow.getInt(CAT_COL_FLAGS); return readTable(name, tableDefPageNumber, flags); }
protected boolean currentRowMatchesImpl(Map<String,?> rowPattern, ColumnMatcher columnMatcher) throws IOException { Row row = getCurrentRow(rowPattern.keySet()); if(rowPattern.size() != row.size()) { return false; } for(Map.Entry<String,Object> e : row.entrySet()) { String columnName = e.getKey(); if(!columnMatcher.matches(getTable(), columnName, rowPattern.get(columnName), e.getValue())) { return false; } } return true; }
private OleBlob getBlob(Row row, String cName) { byte[] bytes = row.getBytes(cName); if (bytes == null) { return null; } return JackcessOleUtil.parseBlob(bytes); }
public OleBlob getOleBlob(Database db) throws UcanaccessSQLException { try { Table t = db.getTable(tableName); Cursor c = CursorBuilder.createPrimaryKeyCursor(t); return c.findFirstRow(key) ? c.getCurrentRow().getBlob(columnName) : null; } catch (IOException e) { throw new UcanaccessSQLException(e); } }
int tableId = cColRow.getInt(COL_TABLE_ID); if(tableId != column.getTable().getTableDefPageNumber()) { throw new IOException(column.withErrorContext( column.getTable().getTableDefPageNumber())); int flatTableId = cColRow.getInt(COL_FLAT_TABLE_ID); int typeObjId = cColRow.getInt(COL_COMPLEX_TYPE_OBJECT_ID);
ps = sqlInsert(t, row, systemTable); for (Map.Entry<String, Object> entry : row.entrySet()) { values.add(value(entry.getValue(), t, entry.getKey(), row));
@Override public TableInfo lookupTable(String tableName) throws IOException { for(Row row : _systemCatalogCursor.newIterable().setColumnNames( SYSTEM_CATALOG_TABLE_DETAIL_COLUMNS)) { Short type = row.getShort(CAT_COL_TYPE); if(!isTableType(type)) { continue; } int parentId = row.getInt(CAT_COL_PARENT_ID); if(parentId != _tableParentId) { continue; } String realName = row.getString(CAT_COL_NAME); if(!tableName.equalsIgnoreCase(realName)) { continue; } Integer pageNumber = row.getInt(CAT_COL_ID); int flags = row.getInt(CAT_COL_FLAGS); String linkedDbName = row.getString(CAT_COL_DATABASE); String linkedTableName = row.getString(CAT_COL_FOREIGN_NAME); return createTableInfo(realName, pageNumber, flags, type, linkedDbName, linkedTableName); } return null; }
String fromName = row.getString(REL_COL_FROM_TABLE); String toName = row.getString(REL_COL_TO_TABLE); toTableName.equalsIgnoreCase(toName))) { String relName = row.getString(REL_COL_NAME); int numCols = row.getInt(REL_COL_COLUMN_COUNT); int flags = row.getInt(REL_COL_FLAGS); rel = new RelationshipImpl(relName, relFromTable, relToTable, flags, numCols); int colIdx = row.getInt(REL_COL_COLUMN_INDEX); ColumnImpl fromCol = relFromTable.getColumn( row.getString(REL_COL_FROM_COLUMN)); ColumnImpl toCol = relToTable.getColumn( row.getString(REL_COL_TO_COLUMN));
private OleBlob getBlob(Row row, String cName) { byte[] bytes = row.getBytes(cName); if (bytes == null) { return null; } return JackcessOleUtil.parseBlob(bytes); }
private void handleOLE(Row row, String cName, XHTMLContentHandler xhtml) throws IOException, SAXException, TikaException { OleBlob blob = row.getBlob(cName);