本文整理汇总了Java中org.hsqldb.RowAVL类的典型用法代码示例。如果您正苦于以下问题:Java RowAVL类的具体用法?Java RowAVL怎么用?Java RowAVL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RowAVL类属于org.hsqldb包,在下文中一共展示了RowAVL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rollbackRow
import org.hsqldb.RowAVL; //导入依赖的package包/类
public void rollbackRow(Session session, Row row, int changeAction,
int txModel) {
switch (changeAction) {
case RowAction.ACTION_DELETE :
if (txModel == TransactionManager.LOCKS) {
((RowAVL) row).setNewNodes(this);
indexRow(session, row);
}
break;
case RowAction.ACTION_INSERT :
delete(session, row);
remove(row);
break;
case RowAction.ACTION_INSERT_DELETE :
// INSERT + DELETE
remove(row);
break;
}
}
示例2: delete
import org.hsqldb.RowAVL; //导入依赖的package包/类
/**
* Row might have changed from memory to disk or indexes added
*/
public void delete(Session session, Row row) {
NodeAVL node = ((RowAVL) row).getNode(0);
int count = 0;
while (node != null) {
count++;
node = node.nNext;
}
if ((isCached ^ !row.isMemory()) || count != indexList.length) {
row = ((Table) table).getDeleteRowFromLog(session, row.getData());
}
if (row != null) {
super.delete(session, row);
}
}
示例3: indexRows
import org.hsqldb.RowAVL; //导入依赖的package包/类
public final void indexRows(Session session) {
writeLock();
try {
for (int i = 1; i < indexList.length; i++) {
setAccessor(indexList[i], null);
}
RowIterator it = rowIterator();
while (it.hasNext()) {
Row row = it.getNextRow();
((RowAVL) row).clearNonPrimaryNodes();
for (int i = 1; i < indexList.length; i++) {
indexList[i].insert(session, this, row);
}
}
} finally {
writeUnlock();
}
}
示例4: reindex
import org.hsqldb.RowAVL; //导入依赖的package包/类
public void reindex(Session session, Index index) {
writeLock();
try {
setAccessor(index, null);
RowIterator it = table.rowIterator(this);
while (it.hasNext()) {
RowAVL row = (RowAVL) it.getNextRow();
row.getNode(index.getPosition()).delete();
index.insert(session, this, row);
}
} finally {
writeUnlock();
}
}
示例5: dropIndexFromRows
import org.hsqldb.RowAVL; //导入依赖的package包/类
void dropIndexFromRows(Index primaryIndex, Index oldIndex) {
RowIterator it = primaryIndex.firstRow(this);
int position = oldIndex.getPosition() - 1;
while (it.hasNext()) {
Row row = it.getNextRow();
int i = position - 1;
NodeAVL backnode = ((RowAVL) row).getNode(0);
while (i-- > 0) {
backnode = backnode.nNext;
}
backnode.nNext = backnode.nNext.nNext;
}
it.release();
}
示例6: getNewCachedObject
import org.hsqldb.RowAVL; //导入依赖的package包/类
public CachedObject getNewCachedObject(Session session,
Object object)
{
Row row = new RowAVL(table, (Object[]) object);
if (session != null) {
RowAction.addAction(session, RowAction.ACTION_INSERT, table, row);
}
int id = rowIdSequence++;
row.setPos(id);
rowIdMap.put(id, row);
return row;
}
示例7: dropIndexFromRows
import org.hsqldb.RowAVL; //导入依赖的package包/类
void dropIndexFromRows(Index primaryIndex,
Index oldIndex) {
RowIterator it = primaryIndex.firstRow(this);
int position = oldIndex.getPosition() - 1;
while (it.hasNext()) {
Row row = it.getNextRow();
int i = position - 1;
NodeAVL backnode = ((RowAVL) row).getNode(0);
while (i-- > 0) {
backnode = backnode.nNext;
}
backnode.nNext = backnode.nNext.nNext;
}
}
示例8: getAccessor
import org.hsqldb.RowAVL; //导入依赖的package包/类
public CachedObject getAccessor(Index key) {
NodeAVL node = (NodeAVL) accessorList[key.getPosition()];
if (node == null) {
return null;
}
if (!node.isInMemory()) {
RowAVL row = (RowAVL) get(node.getPos(), false);
node = row.getNode(key.getPosition());
accessorList[key.getPosition()] = node;
}
return node;
}
示例9: indexRows
import org.hsqldb.RowAVL; //导入依赖的package包/类
public final void indexRows() {
RowIterator it = rowIterator();
for (int i = 1; i < indexList.length; i++) {
setAccessor(indexList[i], null);
}
while (it.hasNext()) {
Row row = it.getNextRow();
if (row instanceof RowAVL) {
((RowAVL) row).clearNonPrimaryNodes();
}
for (int i = 1; i < indexList.length; i++) {
indexList[i].insert(null, this, row);
}
}
}
示例10: getNewCachedObject
import org.hsqldb.RowAVL; //导入依赖的package包/类
public CachedObject getNewCachedObject(Session session, Object object,
boolean tx) {
int id;
synchronized (this) {
id = rowIdSequence++;
}
Row row = new RowAVL(table, (Object[]) object, id, this);
if (tx) {
RowAction action = new RowAction(session, table,
RowAction.ACTION_INSERT, row,
null);
row.rowAction = action;
}
return row;
}
示例11: delete
import org.hsqldb.RowAVL; //导入依赖的package包/类
/**
* Row might have changed from memory to disk or indexes added
*/
public void delete(Session session, Row row) {
NodeAVL node = ((RowAVL) row).getNode(0);
int count = 0;
while (node != null) {
count++;
node = node.nNext;
}
if ((isCached && row.isMemory()) || count != indexList.length) {
row = ((Table) table).getDeleteRowFromLog(session, row.getData());
}
if (row != null) {
super.delete(session, row);
}
}
示例12: indexRows
import org.hsqldb.RowAVL; //导入依赖的package包/类
public final void indexRows(Session session) {
for (int i = 1; i < indexList.length; i++) {
setAccessor(indexList[i], null);
}
RowIterator it = rowIterator();
while (it.hasNext()) {
Row row = it.getNextRow();
((RowAVL) row).clearNonPrimaryNodes();
for (int i = 1; i < indexList.length; i++) {
indexList[i].insert(session, this, row);
}
}
}
示例13: rollbackRow
import org.hsqldb.RowAVL; //导入依赖的package包/类
public void rollbackRow(Session session, Row row, int changeAction,
int txModel) {
switch (changeAction) {
case RowAction.ACTION_DELETE :
row = (Row) get(row, true);
((RowAVL) row).setNewNodes(this);
row.keepInMemory(false);
indexRow(session, row);
break;
case RowAction.ACTION_INSERT :
delete(session, row);
remove(row.getPos());
break;
case RowAction.ACTION_INSERT_DELETE :
// INSERT + DELEETE
remove(row.getPos());
break;
}
}
示例14: indexRow
import org.hsqldb.RowAVL; //导入依赖的package包/类
public void indexRow(Session session, Row row) {
NodeAVL node = ((RowAVL) row).getNode(0);
int count = 0;
while (node != null) {
count++;
node = node.nNext;
}
if (count != indexList.length) {
resetAccessorKeys(table.getIndexList());
((RowAVL) row).setNewNodes(this);
}
super.indexRow(session, row);
}
示例15: dropIndexFromRows
import org.hsqldb.RowAVL; //导入依赖的package包/类
void dropIndexFromRows(Index primaryIndex, Index oldIndex) {
RowIterator it = primaryIndex.firstRow(this);
int position = oldIndex.getPosition() - 1;
while (it.hasNext()) {
Row row = it.getNextRow();
int i = position - 1;
NodeAVL backnode = ((RowAVL) row).getNode(0);
while (i-- > 0) {
backnode = backnode.nNext;
}
backnode.nNext = backnode.nNext.nNext;
}
}