public long exec() throws SVNException { Map<String, Object> values = new HashMap<String, Object>(); values.put(SVNWCDbSchema.LOCK__Fields.repos_id.toString(), getBind(1)); values.put(SVNWCDbSchema.LOCK__Fields.repos_relpath.toString(), getBind(2)); values.put(SVNWCDbSchema.LOCK__Fields.lock_token.toString(), getBind(3)); values.put(SVNWCDbSchema.LOCK__Fields.lock_owner.toString(), getBind(4)); values.put(SVNWCDbSchema.LOCK__Fields.lock_comment.toString(), getBind(5)); values.put(SVNWCDbSchema.LOCK__Fields.lock_date.toString(), getBind(6)); try { return table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, values); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); return 0; } }
public long exec() throws SVNException { try { int n = 0; while (select.next()) { try { table.insertByFieldNamesOr(SqlJetConflictAction.IGNORE, getInsertValues()); n++; } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); return -1; } } return n; } finally { select.reset(); } }
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(NODES__Fields.local_relpath.toString())); rowValues.put(REVERT_LIST__Fields.actual.toString(), 0); rowValues.put(REVERT_LIST__Fields.op_depth.toString(), cursor.getValue(NODES__Fields.op_depth.toString())); rowValues.put(REVERT_LIST__Fields.repos_id.toString(), cursor.getValue(NODES__Fields.repos_id.toString())); rowValues.put(REVERT_LIST__Fields.kind.toString(), cursor.getValue(NODES__Fields.kind.toString())); 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 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(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 long exec() throws SVNException { Map<String, Object> insertValues = getInsertValues(); if (insertValues == null) { return 0; } statementStarted(); try { beforeInsert(conflictAction, table, insertValues); long n = table.insertByFieldNamesOr(conflictAction, insertValues); statementCompleted(null); return n; } catch (SqlJetException e) { statementCompleted(e); SVNSqlJetDb.createSqlJetError(e); return -1; } }
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); }
@Override public long exec() throws SVNException { InternalSelectStatement stmt = new InternalSelectStatement(sDb); try { stmt.bindf("isi", getBind(1), getBind(2), getBind(3)); boolean haveRow = stmt.next(); assert haveRow; Map<String, Object> values = new HashMap<String, Object>(); values.put(SVNWCDbSchema.NODES__Fields.wc_id.name(), stmt.getColumnString(SVNWCDbSchema.NODES__Fields.wc_id)); values.put(SVNWCDbSchema.NODES__Fields.local_relpath.name(), stmt.getColumnString(SVNWCDbSchema.NODES__Fields.local_relpath)); values.put(SVNWCDbSchema.NODES__Fields.op_depth.name(), stmt.getColumnString(SVNWCDbSchema.NODES__Fields.op_depth)); values.put(SVNWCDbSchema.NODES__Fields.parent_relpath.name(), stmt.getColumnString(SVNWCDbSchema.NODES__Fields.parent_relpath)); values.put(SVNWCDbSchema.NODES__Fields.kind.name(), stmt.getColumnString(SVNWCDbSchema.NODES__Fields.kind)); values.put(SVNWCDbSchema.NODES__Fields.moved_to.name(), stmt.getColumnString(SVNWCDbSchema.NODES__Fields.moved_to)); values.put(SVNWCDbSchema.NODES__Fields.presence.name(), SvnWcDbStatementUtil.getPresenceText(ISVNWCDb.SVNWCDbStatus.Deleted)); try { return table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, values); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); return 0; } } finally { stmt.reset(); } }
public long exec() throws SVNException { try { select.bindf("is", getBind(1), getBind(2)); select.next(); try { table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, getInsertValues()); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); return -1; } return 1; } finally { select.reset(); } }
public long exec() throws SVNException { select.bindf("isi", getBind(1), getBind(2), 0); try { int n = 0; while (select.next()) { try { table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, getInsertValues()); n++; } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); return -1; } } return n; } finally { select.reset(); } }
public long exec() throws SVNException { select.bindf("isi", getBind(1), getBind(2), 0); try { int n = 0; while (select.next()) { try { table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, getInsertValues()); n++; } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e); return -1; } } return n; } finally { select.reset(); } }
values.put(SVNWCDbSchema.NODES__Fields.moved_to.name(), haveRow2 ? stmt2.getColumnString(SVNWCDbSchema.NODES__Fields.moved_to) : null); try { return table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, values); } catch (SqlJetException e) { SVNSqlJetDb.createSqlJetError(e);