本文整理汇总了Java中com.healthmarketscience.jackcess.Row类的典型用法代码示例。如果您正苦于以下问题:Java Row类的具体用法?Java Row怎么用?Java Row使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Row类属于com.healthmarketscience.jackcess包,在下文中一共展示了Row类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSecondaryValues
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
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);
}
}
示例2: doCheckOfficeDb
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
private static void doCheckOfficeDb(Database db, int addedRows) throws Exception
{
Table t = db.getTable("Table1");
List<Row> expectedRows =
DatabaseTest.createExpectedTable(
DatabaseTest.createExpectedRow(
"ID", 1,
"Field1", "foo"));
if(addedRows > 0) {
expectedRows = new ArrayList<Row>(expectedRows);
int nextId = 2;
for(int i = 0; i < addedRows; ++i) {
expectedRows.add(DatabaseTest.createExpectedRow(
"ID", nextId++,
"Field1", "this is the value of col1 " + i));
}
}
DatabaseTest.assertTable(expectedRows, t);
}
示例3: matchPattern
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
/**
* Creates a filter based on a row pattern.
*
* @param rowPattern Map from column names to the values to be matched.
* A table row will match the target if
* {@code ObjectUtils.equals(rowPattern.get(s), row.get(s))}
* for all column names in the pattern map.
* @return a filter which matches table rows which match the values in the
* row pattern
*/
public static RowFilter matchPattern(final Map<String,?> rowPattern)
{
return new RowFilter() {
@Override
public boolean matches(Row row)
{
for(Map.Entry<String,?> e : rowPattern.entrySet()) {
if(!ObjectUtils.equals(e.getValue(), row.get(e.getKey()))) {
return false;
}
}
return true;
}
};
}
示例4: currentRowMatchesEntryImpl
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
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;
}
示例5: getTable
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
/**
* @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);
}
示例6: getNewObjectOwner
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
private byte[] getNewObjectOwner() throws IOException {
if(_newObjOwner == null) {
// there doesn't seem to be any obvious way to find the main "owner" of
// an access db, but certain db objects seem to have the common db
// owner. we attempt to grab the db properties object and use its
// owner.
Row msysDbRow = _tableFinder.getObjectRow(
getDbParentId(), OBJECT_NAME_DB_PROPS,
Collections.singleton(CAT_COL_OWNER));
byte[] owner = null;
if(msysDbRow != null) {
owner = msysDbRow.getBytes(CAT_COL_OWNER);
}
_newObjOwner = (((owner != null) && (owner.length > 0)) ?
owner : SYS_DEFAULT_SID);
}
return _newObjOwner;
}
示例7: getPropertiesForDbObject
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
/**
* @return property group for the given "database" object
*/
private PropertyMaps getPropertiesForDbObject(String dbName)
throws IOException
{
Row objectRow = _tableFinder.getObjectRow(
getDbParentId(), dbName, SYSTEM_CATALOG_PROPS_COLUMNS);
byte[] propsBytes = null;
int objectId = -1;
RowIdImpl rowId = null;
if(objectRow != null) {
propsBytes = objectRow.getBytes(CAT_COL_PROPS);
objectId = objectRow.getInt(CAT_COL_ID);
rowId = (RowIdImpl)objectRow.getId();
}
return readProperties(propsBytes, objectId, rowId);
}
示例8: collectNewObjectSIDs
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
/**
* 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);
}
}
示例9: lookupTable
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
@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);
}
示例10: currentRowMatchesImpl
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
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;
}
示例11: getRawValues
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
public List<Row> getRawValues(int complexValueFk,
Collection<String> columnNames)
throws IOException
{
Iterator<Row> entryIter =
getComplexValFkIter(complexValueFk, columnNames);
if(!entryIter.hasNext()) {
return Collections.emptyList();
}
List<Row> values = new ArrayList<Row>();
while(entryIter.hasNext()) {
values.add(entryIter.next());
}
return values;
}
示例12: nullSecondaryValues
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
private static void nullSecondaryValues(Joiner joiner, Object[] oldFromRow)
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) {
toCols.get(i).getColumn().setRowValue(toRow, null);
}
toCursor.updateCurrentRow(toRow);
}
}
示例13: doTestJoinerDelete
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
private static void doTestJoinerDelete(Joiner t2t1Join) throws Exception
{
assertEquals(4, countRows(t2t1Join.getToTable()));
Row row = createExpectedRow("id", 1);
assertTrue(t2t1Join.hasRows(row));
assertTrue(t2t1Join.deleteRows(row));
assertFalse(t2t1Join.hasRows(row));
assertFalse(t2t1Join.deleteRows(row));
assertEquals(2, countRows(t2t1Join.getToTable()));
for(Row t1Row : t2t1Join.getToTable()) {
assertFalse(t1Row.get("otherfk1").equals(1));
}
}
示例14: createT2T1Data
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
private static Map<Integer,List<Row>> createT2T1Data()
{
Map<Integer,List<Row>> data = new
HashMap<Integer,List<Row>>();
data.put(0,
createExpectedTable(
createExpectedRow("id", 0, "otherfk1", 0, "otherfk2", 10,
"data", "baz0", "otherfk3", 0)));
data.put(1,
createExpectedTable(
createExpectedRow("id", 1, "otherfk1", 1, "otherfk2", 11,
"data", "baz11", "otherfk3", 0),
createExpectedRow("id", 2, "otherfk1", 1, "otherfk2", 11,
"data", "baz11-2", "otherfk3", 0)));
data.put(2,
createExpectedTable(
createExpectedRow("id", 3, "otherfk1", 2, "otherfk2", 13,
"data", "baz13", "otherfk3", 0)));
return data;
}
示例15: createT3T1Data
import com.healthmarketscience.jackcess.Row; //导入依赖的package包/类
private static Map<Integer,List<Row>> createT3T1Data()
{
Map<Integer,List<Row>> data = new HashMap<Integer,List<Row>>();
data.put(10,
createExpectedTable(
createExpectedRow("id", 0, "otherfk1", 0, "otherfk2", 10,
"data", "baz0", "otherfk3", 0)));
data.put(11,
createExpectedTable(
createExpectedRow("id", 1, "otherfk1", 1, "otherfk2", 11,
"data", "baz11", "otherfk3", 0),
createExpectedRow("id", 2, "otherfk1", 1, "otherfk2", 11,
"data", "baz11-2", "otherfk3", 0)));
data.put(12,
createExpectedTable());
data.put(13,
createExpectedTable(
createExpectedRow("id", 3, "otherfk1", 2, "otherfk2", 13,
"data", "baz13", "otherfk3", 0)));
return data;
}