コード例 #1
0
        private long ImplementDeleteRow(
            Int64 queryId,
            Int64 sessionId,
            string rowHash,
            SQLiteConnection connection,
            SQLiteTransaction transaction = null
            )
        {
            RowDeleteCommand       deleteCommand = new RowDeleteCommand(this.Connection, this.TableDefinition);
            string                 clause        = CommonRowFiller.GetIdentClause();
            List <SQLiteParameter> parameters    = CommonRowFiller.GetIdentParameters(queryId, sessionId);

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

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

            parameters.Add(rowHashParam);

            deleteCommand.SetCommandConstraints(clause, parameters, transaction);

            return(deleteCommand.Execute(100));
        }
コード例 #2
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));
        }
コード例 #3
0
        public void ClearAutoGeneratedRows(Int64 queryId, Int64 sessionId)
        {
            using (this.Connection.OpenWrapper())
            {
                RowDeleteCommand       deleteCommand = new RowDeleteCommand(this.Connection, this.TableDefinition);
                string                 clause        = CommonRowFiller.GetIdentClause();
                List <SQLiteParameter> parameters    = CommonRowFiller.GetIdentParameters(queryId, sessionId);

                deleteCommand.SetCommandConstraints(clause, parameters);

                deleteCommand.Execute(100);
            }
        }
コード例 #4
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));
        }