Beispiel #1
0
        private Int64 ImplementUpdateRow(
            long queryId,
            long sessionId,
            string hashOld,
            ITableRow dataRow,
            SQLiteConnection connection,
            SQLiteTransaction transaction = null
            )
        {
            RowUpdateByHashCommand updateCommand = new RowUpdateByHashCommand(connection, this.TableDefinition);
            string clause = CommonRowFiller.GetIdentClause();
            List <SQLiteParameter> parameters = CommonRowFiller.GetIdentParameters(queryId, sessionId);

            SQLiteParameter rowHashParam = new SQLiteParameter("@rowhashold", DbType.String)
            {
                Value = hashOld
            };

            clause += " AND [" + CommonRowFiller.RowHashFieldName + "] = @rowhashold";

            parameters.Add(rowHashParam);

            updateCommand.SetCommandConstraints(clause, parameters, String.Empty, true, dataRow, transaction);

            return(updateCommand.Execute(100));
        }
Beispiel #2
0
        private long ImplementUpdateRowOrderByHash(
            long queryId,
            long sessionId,
            string rowHash,
            long rowId,
            SQLiteConnection connection,
            SQLiteTransaction transaction = null
            )
        {
            RowUpdateByHashCommand updateCommand = new RowUpdateByHashCommand(connection, this.TableDefinition);
            string clause = CommonRowFiller.GetIdentClause();
            List <SQLiteParameter> parameters = CommonRowFiller.GetIdentParameters(queryId, sessionId);

            SQLiteParameter rowIdParam = new SQLiteParameter("@rowid", DbType.Int64)
            {
                Value = rowId
            };

            SQLiteParameter rowHashParam = new SQLiteParameter("@rowhash", DbType.String)
            {
                Value = rowHash
            };

            clause += " AND [" + CommonRowFiller.RowHashFieldName + "] = @rowhash";

            parameters.Add(rowIdParam);
            parameters.Add(rowHashParam);

            updateCommand.SetCommandConstraints(
                clause,
                parameters,
                "[" + CommonRowFiller.RowOrderFieldName + "] = @rowid",
                false,
                null,
                transaction
                );

            return(updateCommand.Execute(100));
        }