public long getInteger(String fieldName) throws SqlJetException { return cursor.getInteger(fieldName); }
public long getInteger(int field) throws SqlJetException { return cursor.getInteger(field); }
public long getInteger(int columnIndex) throws SqlJetException { if (result instanceof Integer && columnIndex == 0) { return ((Integer) result).longValue(); } return cursor.getInteger(columnIndex); }
myRevision = cursor.getInteger(REVISION_FIELD); myOffset = cursor.getInteger(OFFSET_FIELD); mySize = cursor.getInteger(SIZE_FIELD); myExpandedSize = cursor.getInteger(EXPANDED_SIZE_FIELD);
myRevision = cursor.getInteger(REVISION_FIELD); myOffset = cursor.getInteger(OFFSET_FIELD); mySize = cursor.getInteger(SIZE_FIELD); myExpandedSize = cursor.getInteger(EXPANDED_SIZE_FIELD);
myRevision = cursor.getInteger(REVISION_FIELD); myOffset = cursor.getInteger(OFFSET_FIELD); mySize = cursor.getInteger(SIZE_FIELD); myExpandedSize = cursor.getInteger(EXPANDED_SIZE_FIELD);
protected long getColumnLong(String f) throws SVNException { try { if (getCursor() == null || getCursor().eof()) return 0; return getCursor().getInteger(f); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); return 0; } }
public void statementCompleted(SqlJetDb db, SqlJetException error) throws SqlJetException { try { if (error == null && !getTriggerValues().isEmpty()) { Map<String, Object> values = new HashMap<String, Object>(); ISqlJetTable pristineTable = db.getTable(SVNWCDbSchema.PRISTINE.toString()); for (String checksum : getTriggerValues().keySet()) { long delta = getTriggerValues().get(checksum); if (delta == 0) { continue; } ISqlJetCursor cursor = pristineTable.lookup(null, checksum); if (cursor != null && !cursor.eof()) { long refcount = cursor.getInteger(SVNWCDbSchema.PRISTINE__Fields.refcount.toString()); refcount += delta; if (refcount < 0) { refcount = 0; } values.put(SVNWCDbSchema.PRISTINE__Fields.refcount.toString(), refcount); cursor.updateByFieldNames(values); } cursor.close(); } } } finally { checksumTriggerValues = null; } }
public void beforeDelete(ISqlJetCursor cursor) throws SqlJetException { ISqlJetTable table = db.getDb().getTemporaryDatabase().getTable(SVNWCDbSchema.REVERT_LIST.toString()); Map<String, Object> rowValues = new HashMap<String, Object>(); rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.local_relpath.toString(), cursor.getValue(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString())); rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.actual.toString(), 1); rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.conflict_data.toString(), getConflictData(cursor)); if (!cursor.isNull(SVNWCDbSchema.ACTUAL_NODE__Fields.properties.toString()) || !cursor.isNull(SVNWCDbSchema.ACTUAL_NODE__Fields.tree_conflict_data.toString())) { rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), 1); } else if (!exists(db.getDb(), cursor.getInteger(SVNWCDbSchema.ACTUAL_NODE__Fields.wc_id.toString()), cursor.getString(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString()))) { rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), 1); } else { rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), null); } table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, rowValues); }
public void beforeUpdate(ISqlJetCursor cursor, Map<String, Object> newValues) throws SqlJetException { ISqlJetTable table = db.getDb().getTemporaryDatabase().getTable(SVNWCDbSchema.REVERT_LIST.toString()); Map<String, Object> rowValues = new HashMap<String, Object>(); rowValues.put(REVERT_LIST__Fields.local_relpath.toString(), cursor.getValue(ACTUAL_NODE__Fields.local_relpath.toString())); rowValues.put(REVERT_LIST__Fields.actual.toString(), 1); rowValues.put(REVERT_LIST__Fields.conflict_data.toString(), cursor.getBlobAsArray(ACTUAL_NODE__Fields.conflict_data.toString())); if (!cursor.isNull(ACTUAL_NODE__Fields.properties.toString()) || !cursor.isNull(ACTUAL_NODE__Fields.tree_conflict_data.toString())) { rowValues.put(REVERT_LIST__Fields.notify.toString(), 1); } else if (!exists(db.getDb().getTemporaryDatabase(), cursor.getInteger(ACTUAL_NODE__Fields.wc_id.toString()), cursor.getString(ACTUAL_NODE__Fields.local_relpath.toString()))) { rowValues.put(REVERT_LIST__Fields.notify.toString(), 1); } else { rowValues.put(REVERT_LIST__Fields.notify.toString(), null); } table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, rowValues); }
try { while(!cursor.eof()) { long opDepth = cursor.getInteger(NODES__Fields.op_depth.toString()); if (opDepth == 0) { String checksum = cursor.getString(NODES__Fields.checksum.toString()); try { if (!cursor.eof()) { long refCount = cursor.getInteger(PRISTINE__Fields.refcount.toString()); if (refCount != refcountTable.get(checksum)) { Map<String, Object> value = new HashMap<String, Object>();
public void beforeUpdate(ISqlJetCursor cursor, Map<String, Object> newValues) throws SqlJetException { ISqlJetTable table = db.getDb().getTemporaryDatabase().getTable(SVNWCDbSchema.REVERT_LIST.toString()); Map<String, Object> rowValues = new HashMap<String, Object>(); rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.local_relpath.toString(), cursor.getValue(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString())); rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.actual.toString(), 1); rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.conflict_data.toString(), getConflictData(cursor)); if (!cursor.isNull(SVNWCDbSchema.ACTUAL_NODE__Fields.properties.toString()) || !cursor.isNull(SVNWCDbSchema.ACTUAL_NODE__Fields.tree_conflict_data.toString())) { rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), 1); } else if (!exists(db.getDb().getTemporaryDatabase(), cursor.getInteger(SVNWCDbSchema.ACTUAL_NODE__Fields.wc_id.toString()), cursor.getString(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString()))) { rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), 1); } else { rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), null); } table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, rowValues); }
public void beforeDelete(ISqlJetCursor cursor) throws SqlJetException { ISqlJetTable table = db.getDb().getTemporaryDatabase().getTable(SVNWCDbSchema.REVERT_LIST.toString()); Map<String, Object> rowValues = new HashMap<String, Object>(); rowValues.put(REVERT_LIST__Fields.local_relpath.toString(), cursor.getValue(ACTUAL_NODE__Fields.local_relpath.toString())); rowValues.put(REVERT_LIST__Fields.actual.toString(), 1); rowValues.put(REVERT_LIST__Fields.conflict_data.toString(), cursor.getBlobAsArray(ACTUAL_NODE__Fields.conflict_data.toString())); if (!cursor.isNull(ACTUAL_NODE__Fields.properties.toString()) || !cursor.isNull(ACTUAL_NODE__Fields.tree_conflict_data.toString())) { rowValues.put(REVERT_LIST__Fields.notify.toString(), 1); } else if (!exists(db.getDb(), cursor.getInteger(ACTUAL_NODE__Fields.wc_id.toString()), cursor.getString(ACTUAL_NODE__Fields.local_relpath.toString()))) { rowValues.put(REVERT_LIST__Fields.notify.toString(), 1); } else { rowValues.put(REVERT_LIST__Fields.notify.toString(), null); } table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, rowValues); }
public Long getMaxOpDepth(Long wcId, String localRelpath) throws SVNException { ISqlJetCursor c = null; try { c = getTable().lookup(null, wcId, localRelpath); c = c.reverse(); if (!c.eof()) { long rowDepth = c.getInteger(SVNWCDbSchema.NODES__Fields.op_depth.toString()); if (rowDepth >= minDepth) { return rowDepth; } } } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); } finally { try { c.close(); } catch (SqlJetException e) { } } return null; }
byte phase = (byte) cursor.getInteger(PHASE_COLUMN); byte exceptionType = (byte) cursor.getInteger(EXCEPTION_COLUMN); map.put(SQLiteStateManager.this.listener.createInvocationEvent(transactionId, phase, exceptionType), new HashMap<String, InvokerEvent>()); byte phase = (byte) cursor.getInteger(PHASE_COLUMN); DurabilityEvent event = SQLiteStateManager.this.listener.createEvent(transactionId, phase); Map<String, InvokerEvent> invokers = map.get(event);
if (fileExternal) { } else if (rowRelPath.equals(parentRelPath)) { long opDepth = cursor.getInteger(SVNWCDbSchema.NODES__Fields.op_depth.toString()); if (opDepth == 0) { parents.put(rowRelPath, cursor.getString(SVNWCDbSchema.NODES__Fields.repos_path.toString())); long opDepth = cursor.getInteger(SVNWCDbSchema.NODES__Fields.op_depth.toString()); if (opDepth == 0) { String rowReposRelpath = cursor.getString(SVNWCDbSchema.NODES__Fields.repos_path.toString());
private static Map<SvnChecksum, Integer> loadChecksumsRefcountsFromTable(SVNWCDbRoot root) throws SVNException { Map<SvnChecksum, Integer> checksumToRefCount = new HashMap<SvnChecksum, Integer>(); final SqlJetDb db = root.getSDb().getDb(); try { final ISqlJetTable pristineTable = db.getTable(SVNWCDbSchema.PRISTINE.name()); db.beginTransaction(SqlJetTransactionMode.READ_ONLY); final ISqlJetCursor cursor = pristineTable.open(); for (; !cursor.eof(); cursor.next()) { String sha1ChecksumString = cursor.getString(PRISTINE__Fields.checksum.name()); if (sha1ChecksumString == null) { continue; } SvnChecksum sha1Checksum = SvnChecksum.fromString(sha1ChecksumString); long refcount = cursor.getInteger(PRISTINE__Fields.refcount.name()); checksumToRefCount.put(sha1Checksum, (int)refcount); } cursor.close(); } catch (SqlJetException e) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_DB_ERROR, e); SVNErrorManager.error(errorMessage, e, SVNLogType.WC); } finally { try { db.commit(); } catch (SqlJetException ignore) { } } return checksumToRefCount; }
if ("".equals(localRelPathStr) || rowRelPath.equals(localRelPathStr) || rowRelPath.startsWith(localRelPathStr + "/")) { matched = true; long opDepth = cursor.getInteger(SVNWCDbSchema.NODES__Fields.op_depth.toString()); if (opDepth > 0) { return true; return true; long size = cursor.getInteger(SVNWCDbSchema.NODES__Fields.translated_size.toString()); long date = cursor.getInteger(SVNWCDbSchema.NODES__Fields.last_mod_time.toString()); if (size != -1 && date != 0) { if (size != SVNFileUtil.getFileLength(localFile)) {
} else if ("".equals(localRelPathStr) || rowRelPath.equals(localRelPathStr) || rowRelPath.startsWith(localRelPathStr + "/")) { matched = true; long opDepth = cursor.getInteger(SVNWCDbSchema.NODES__Fields.op_depth.toString()); if (opDepth == 0) { SVNWCDbStatus presence = SvnWcDbStatementUtil.parsePresence(cursor.getString(SVNWCDbSchema.NODES__Fields.presence.toString()));