/** * 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); } }
@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; }
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)); }
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>()); for(Row row : queryInfo) { 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));
public void getTableNames(Set<String> tableNames, boolean normalTables, boolean systemTables, boolean linkedTables) throws IOException { for(Row row : getTableNamesCursor().newIterable().setColumnNames( SYSTEM_CATALOG_COLUMNS)) { String tableName = row.getString(CAT_COL_NAME); int flags = row.getInt(CAT_COL_FLAGS); Short type = row.getShort(CAT_COL_TYPE); int parentId = row.getInt(CAT_COL_PARENT_ID); if(parentId != _tableParentId) { continue; } if(TYPE_TABLE.equals(type)) { if(!isSystemObject(flags)) { if(normalTables) { tableNames.add(tableName); } } else if(systemTables) { tableNames.add(tableName); } } else if(TYPE_LINKED_TABLE.equals(type) && linkedTables) { tableNames.add(tableName); } } }
@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); }
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); }
/** * @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); }
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);