/// <summary>
        /// 获得序列
        /// </summary>
        /// <param name="fullName">序列名</param>
        /// <param name="defaultSequence">默认序列</param>
        /// <returns>序列实体</returns>
        protected CiSequenceEntity GetSequenceByLock(string fullName, int defaultSequence)
        {
            CiSequenceEntity sequenceEntity = new CiSequenceEntity();

            // 这里主要是为了判断是否存在
            sequenceEntity = this.GetEntityByName(fullName);
            if (sequenceEntity == null)
            {
                // 这里添加记录时加锁机制。
                // 是否已经被锁住
                this.ReturnStatusCode = StatusCode.CanNotLock.ToString();
                for (int i = 0; i < SystemInfo.LockNoWaitCount; i++)
                {
                    // 被锁定的记录数
                    int lockCount = DbCommonLibary.LockNoWait(DBProvider, CiSequenceTable.TableName, CiSequenceTable.FieldFullName, CiSequenceTable.TableName);
                    if (lockCount > 0)
                    {
                        sequenceEntity.FullName  = fullName;
                        sequenceEntity.Reduction = defaultSequence - 1;
                        sequenceEntity.Sequence  = defaultSequence;
                        sequenceEntity.Step      = DefaultStep;
                        this.AddEntity(sequenceEntity);

                        this.ReturnStatusCode = StatusCode.LockOK.ToString();
                        break;
                    }
                    else
                    {
                        System.Threading.Thread.Sleep(RandomHelper.GetRandom(1, SystemInfo.LockNoWaitTickMilliSeconds));
                    }
                }
                if (this.ReturnStatusCode == StatusCode.LockOK.ToString())
                {
                    // XuWangBin 这个是否能省略
                    sequenceEntity = this.GetEntityByName(fullName);
                }
            }
            else
            {
                // 若记录已经存在,加锁,然后读取记录。
                // 是否已经被锁住
                this.ReturnStatusCode = StatusCode.CanNotLock.ToString();
                for (int i = 0; i < SystemInfo.LockNoWaitCount; i++)
                {
                    // 被锁定的记录数
                    int lockCount = DbCommonLibary.LockNoWait(DBProvider, CiSequenceTable.TableName, CiSequenceTable.FieldFullName, fullName);
                    if (lockCount > 0)
                    {
                        sequenceEntity        = this.GetEntityByName(fullName);
                        this.ReturnStatusCode = StatusCode.LockOK.ToString();
                        break;
                    }
                    else
                    {
                        System.Threading.Thread.Sleep(RandomHelper.GetRandom(1, SystemInfo.LockNoWaitTickMilliSeconds));
                    }
                }
            }
            return(sequenceEntity);
        }
        /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="ciSequenceEntity">实体</param>
        public string AddEntity(CiSequenceEntity ciSequenceEntity)
        {
            string sequence = string.Empty;

            this.Identity = false;
            SQLBuilder sqlBuilder = new SQLBuilder(DBProvider, this.Identity, this.ReturnId);

            sqlBuilder.BeginInsert(this.CurrentTableName, CiSequenceTable.FieldId);
            if (!this.Identity)
            {
                if (string.IsNullOrEmpty(ciSequenceEntity.Id))
                {
                    sequence            = BusinessLogic.NewGuid();
                    ciSequenceEntity.Id = sequence;
                }
                sqlBuilder.SetValue(CiSequenceTable.FieldId, ciSequenceEntity.Id);
            }
            else
            {
                if (!this.ReturnId && (DBProvider.CurrentDbType == CurrentDbType.Oracle || DBProvider.CurrentDbType == CurrentDbType.DB2))
                {
                    if (DBProvider.CurrentDbType == CurrentDbType.Oracle)
                    {
                        sqlBuilder.SetFormula(CiSequenceTable.FieldId, "SEQ_" + this.CurrentTableName.ToUpper() + ".NEXTVAL ");
                    }
                    if (DBProvider.CurrentDbType == CurrentDbType.DB2)
                    {
                        sqlBuilder.SetFormula(CiSequenceTable.FieldId, "NEXT VALUE FOR SEQ_" + this.CurrentTableName.ToUpper());
                    }
                }
                else
                {
                    if (this.Identity && (DBProvider.CurrentDbType == CurrentDbType.Oracle || DBProvider.CurrentDbType == CurrentDbType.DB2))
                    {
                        if (string.IsNullOrEmpty(ciSequenceEntity.Id.ToString()))
                        {
                            if (string.IsNullOrEmpty(sequence))
                            {
                                CiSequenceManager sequenceManager = new CiSequenceManager(DBProvider, this.Identity);
                                sequence = sequenceManager.GetSequence(this.CurrentTableName);
                            }
                            ciSequenceEntity.Id = sequence;
                        }
                        sqlBuilder.SetValue(CiSequenceTable.FieldId, ciSequenceEntity.Id);
                    }
                }
            }
            this.SetEntity(sqlBuilder, ciSequenceEntity);
            sqlBuilder.SetDBNow(CiSequenceTable.FieldCreateOn);
            if (this.Identity && (DBProvider.CurrentDbType == CurrentDbType.SqlServer || DBProvider.CurrentDbType == CurrentDbType.Access))
            {
                sequence = sqlBuilder.EndInsert().ToString();
            }
            else
            {
                sqlBuilder.EndInsert();
            }
            return(sequence);
        }
        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="ciSequenceEntity">实体</param>
        public int UpdateEntity(CiSequenceEntity ciSequenceEntity)
        {
            SQLBuilder sqlBuilder = new SQLBuilder(DBProvider);

            sqlBuilder.BeginUpdate(this.CurrentTableName);
            this.SetEntity(sqlBuilder, ciSequenceEntity);
            sqlBuilder.SetWhere(CiSequenceTable.FieldId, ciSequenceEntity.Id);
            return(sqlBuilder.EndUpdate());
        }
 /// <summary>
 /// 批量产生主键
 /// </summary>
 /// <param name="sequenceEntity">实体</param>
 /// <param name="sequenceCount">序列个数</param>
 /// <returns>主键数组</returns>
 private string[] GetSequence(CiSequenceEntity sequenceEntity, int sequenceCount)
 {
     string[] returnValue = new string[sequenceCount];
     for (int i = 0; i < sequenceCount; i++)
     {
         returnValue[i]           = GetSequence(sequenceEntity);
         sequenceEntity.Sequence += sequenceEntity.Step;
     }
     return(returnValue);
 }
 /// <summary>
 /// 设置实体
 /// </summary>
 /// <param name="sqlBuilder">SQL语句生成器</param>
 /// <param name="ciSequenceEntity">实体</param>
 private void SetEntity(SQLBuilder sqlBuilder, CiSequenceEntity ciSequenceEntity)
 {
     sqlBuilder.SetValue(CiSequenceTable.FieldFullName, ciSequenceEntity.FullName);
     sqlBuilder.SetValue(CiSequenceTable.FieldPrefix, ciSequenceEntity.Prefix);
     sqlBuilder.SetValue(CiSequenceTable.FieldSeparate, ciSequenceEntity.Separate);
     sqlBuilder.SetValue(CiSequenceTable.FieldSequence, ciSequenceEntity.Sequence);
     sqlBuilder.SetValue(CiSequenceTable.FieldReduction, ciSequenceEntity.Reduction);
     sqlBuilder.SetValue(CiSequenceTable.FieldStep, ciSequenceEntity.Step);
     sqlBuilder.SetValue(CiSequenceTable.FieldDescription, ciSequenceEntity.Description);
 }
        /// <summary>
        /// 按名称获取实体
        /// </summary>
        /// <param name="fullName">序列名称</param>
        /// <returns>实体</returns>
        CiSequenceEntity GetEntityByName(string fullName)
        {
            CiSequenceEntity sequenceEntity = null;
            DataTable        dataTable      = this.GetDT(CiSequenceTable.FieldFullName, fullName);

            if (dataTable.Rows.Count > 0)
            {
                sequenceEntity = BaseEntity.Create <CiSequenceEntity>(dataTable);
            }
            return(sequenceEntity);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public CiSequenceEntity GetEntity(UserInfo userInfo, string id)
        {
            CiSequenceEntity sequenceEntity = null;
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.SequenceService_GetEntity);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                sequenceEntity = new CiSequenceManager(dbProvider, userInfo).GetEntity(id);
            });

            return(sequenceEntity);
        }
        //
        // 读取序列的
        //


        /// <summary>
        /// 获取序列
        /// </summary>
        /// <param name="sequenceEntity">序列实体</param>
        /// <returns>序列</returns>
        string GetSequence(CiSequenceEntity sequenceEntity)
        {
            string sequence = sequenceEntity.Sequence.ToString();

            if (this.FillZeroPrefix)
            {
                sequence = BusinessLogic.RepeatString("0", (this.SequenceLength - sequenceEntity.Sequence.ToString().Length)) + sequenceEntity.Sequence.ToString();
            }
            if (this.UsePrefix)
            {
                sequence = sequenceEntity.Prefix + sequenceEntity.Separate + sequence;
            }
            return(sequence);
        }
        /// <summary>
        /// 获取降序列
        /// </summary>
        /// <param name="sequenceEntity">序列实体</param>
        /// <returns>降序列</returns>
        string GetReduction(CiSequenceEntity sequenceEntity)
        {
            string reduction = sequenceEntity.Reduction.ToString();

            if (this.FillZeroPrefix)
            {
                reduction = BusinessLogic.RepeatString("0", (this.SequenceLength - sequenceEntity.Reduction.ToString().Length)) + sequenceEntity.Reduction.ToString();
            }
            if (this.UsePrefix)
            {
                reduction = sequenceEntity.Prefix + sequenceEntity.Separate + reduction;
            }
            return(reduction);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 获取序列号数组
        /// </summary>
        /// <param name="fullName">序列名称</param>
        /// <param name="sequenceCount">序列个数</param>
        /// <param name="defaultSequence">默认序列</param>
        /// <returns>序列号</returns>
        public string[] GetBatchSequence(string fullName, int sequenceCount, int defaultSequence)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = Environment.TickCount;
            Trace.WriteLine(DateTime.Now.ToString(SystemInfo.TimeFormat) + " :Begin: " + MethodBase.GetCurrentMethod().ReflectedType.Name + "." + MethodBase.GetCurrentMethod().Name);
            #endif

            string[] returnValue = new string[sequenceCount];

            // 这里用锁的机制,提高并发控制能力
            lock (SequenceLock)
            {
                this.DefaultSequence = defaultSequence;
                switch (DBProvider.CurrentDbType)
                {
                case CurrentDbType.Access:
                case CurrentDbType.MySql:
                case CurrentDbType.SqlServer:
                    CiSequenceEntity sequenceEntity = this.GetEntityByAdd(fullName);
                    this.UpdateSequence(fullName, sequenceCount);
                    // 这里循环产生ID数组
                    returnValue = this.GetSequence(sequenceEntity, sequenceCount);
                    break;

                case CurrentDbType.DB2:
                    for (int i = 0; i < sequenceCount; i++)
                    {
                        returnValue[i] = GetDB2Sequence(fullName);
                    }
                    break;

                case CurrentDbType.Oracle:
                    for (int i = 0; i < sequenceCount; i++)
                    {
                        returnValue[i] = GetOracleSequence(fullName);
                    }
                    break;
                }
            }

            // 写入调试信息
            #if (DEBUG)
            int milliEnd = Environment.TickCount;
            Trace.WriteLine(DateTime.Now.ToString(SystemInfo.TimeFormat) + " Ticks: " + TimeSpan.FromMilliseconds(milliEnd - milliStart).ToString() + " :End: " + MethodBase.GetCurrentMethod().ReflectedType.Name + "." + MethodBase.GetCurrentMethod().Name);
            #endif

            return(returnValue);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 获得原序列号
        /// </summary>
        /// <param name="fullName">序列名称</param>
        /// <param name="defaultSequence">默认序列</param>
        /// <param name="sequenceLength">序列长度</param>
        /// <param name="fillZeroPrefix">是否填充补零</param>
        /// <returns>序列号</returns>
        public string GetOldSequence(string fullName, int defaultSequence, int sequenceLength, bool fillZeroPrefix)
        {
            string sequence = string.Empty;

            // 这里用锁的机制,提高并发控制能力
            lock (SequenceLock)
            {
                this.SequenceLength   = sequenceLength;
                this.FillZeroPrefix   = fillZeroPrefix;
                this.DefaultReduction = defaultSequence;
                this.DefaultSequence  = defaultSequence + 1;

                CiSequenceEntity sequenceEntity = GetEntityByAdd(fullName);
                sequence = GetSequence(sequenceEntity);
            }
            return(sequence);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 添加序列
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="sequenceEntity">序列实体</param>
        /// <param name="statusCode">状态码</param>
        /// <param name="statusMessage">状态信息</param>
        /// <returns>主键</returns>
        public string Add(UserInfo userInfo, CiSequenceEntity sequenceEntity, out string statusCode, out string statusMessage)
        {
            string returnValue   = string.Empty;
            string returnCode    = string.Empty;
            string returnMessage = string.Empty;
            var    parameter     = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.SequenceService_Add);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var sequenceManager = new CiSequenceManager(dbProvider, userInfo);
                returnValue         = sequenceManager.Add(sequenceEntity, out returnCode);
                returnMessage       = sequenceManager.GetStateMessage(returnCode);
            });
            statusCode    = returnCode;
            statusMessage = returnMessage;
            return(returnValue);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="sequenceEntity">实体</param>
        /// <param name="statusCode">状态码</param>
        public int Update(CiSequenceEntity sequenceEntity, out string statusCode)
        {
            int returnValue = 0;

            // 检查名称是否重复
            if (this.Exists(CiSequenceTable.FieldFullName, sequenceEntity.FullName, sequenceEntity.Id))
            {
                // 名称已重复
                statusCode = StatusCode.ErrorNameExist.ToString();
            }
            else
            {
                // 进行更新操作
                returnValue = this.UpdateEntity(sequenceEntity);
                statusCode  = returnValue == 1 ? StatusCode.OKUpdate.ToString() : StatusCode.ErrorDeleted.ToString();
            }
            return(returnValue);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sequenceEntity">实体</param>
        /// <param name="statusCode">状态码</param>
        public string Add(CiSequenceEntity sequenceEntity, out string statusCode)
        {
            string returnValue = string.Empty;

            // 检查是否重复
            if (this.Exists(CiSequenceTable.FieldFullName, sequenceEntity.FullName))
            {
                // 名称已重复
                statusCode = StatusCode.ErrorNameExist.ToString();
            }
            else
            {
                returnValue = this.AddEntity(sequenceEntity);
                // 运行成功
                statusCode = StatusCode.OKAdd.ToString();
            }
            return(returnValue);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 获取添加
        /// </summary>
        /// <param name="fullName">序列名</param>
        /// <returns>序列实体</returns>
        CiSequenceEntity GetEntityByAdd(string fullName)
        {
            CiSequenceEntity sequenceEntity = null;

            sequenceEntity = this.GetEntityByName(fullName);
            if (sequenceEntity == null)
            {
                sequenceEntity = new CiSequenceEntity
                {
                    FullName  = fullName,
                    Sequence  = this.DefaultSequence,
                    Reduction = this.DefaultReduction,
                    Step      = DefaultStep,
                    Prefix    = DefaultPrefix,
                    Separate  = DefaultSeparator
                };
                // 这里是为了多种数据库的兼容
                //sequenceEntity.Id = BusinessLogic.NewGuid();
                this.Add(sequenceEntity, true);
            }

            return(sequenceEntity);
        }
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="ciSequenceEntity">实体</param>
 /// <returns>主键</returns>
 public string Add(CiSequenceEntity ciSequenceEntity)
 {
     return(this.AddEntity(ciSequenceEntity));
 }
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="ciSequenceEntity">实体</param>
 public int Update(CiSequenceEntity ciSequenceEntity)
 {
     return(this.UpdateEntity(ciSequenceEntity));
 }
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="ciSequenceEntity">实体</param>
 /// <param name="identity">自增量方式</param>
 /// <returns>主键</returns>
 public string Add(CiSequenceEntity ciSequenceEntity, bool identity)
 {
     this.Identity = identity;
     return(this.AddEntity(ciSequenceEntity));
 }
Ejemplo n.º 19
0
        /// <summary>
        /// 获得序列
        /// </summary>
        /// <param name="fullName">序列名称</param>
        /// <param name="defaultSequence">默认序列</param>
        /// <param name="sequenceLength">序列长度</param>
        /// <param name="fillZeroPrefix">是否填充零</param>
        /// <returns>序列实体</returns>
        public string GetSequence(string fullName, int defaultSequence, int sequenceLength, bool fillZeroPrefix)
        {
            this.DefaultSequence  = defaultSequence;
            this.SequenceLength   = sequenceLength;
            this.FillZeroPrefix   = fillZeroPrefix;
            this.DefaultReduction = defaultSequence - 1;

            // 写入调试信息
            #if (DEBUG)
            int milliStart = Environment.TickCount;
            Trace.WriteLine(DateTime.Now.ToString(SystemInfo.TimeFormat) + " :Begin: " + MethodBase.GetCurrentMethod().ReflectedType.Name + "." + MethodBase.GetCurrentMethod().Name);
            #endif

            CiSequenceEntity sequenceEntity = null;

            // 这里用锁的机制,提高并发控制能力
            lock (SequenceLock)
            {
                switch (DBProvider.CurrentDbType)
                {
                case CurrentDbType.Access:
                case CurrentDbType.MySql:
                case CurrentDbType.SqlServer:
                    sequenceEntity = this.GetEntityByAdd(fullName);
                    this.UpdateSequence(fullName);
                    break;

                case CurrentDbType.Oracle:
                    sequenceEntity = this.GetEntityByAdd(fullName);
                    this.UpdateSequence(fullName);

                    /*
                     * // 这里加锁机制。
                     * if (DBProvider.InTransaction)
                     * {
                     *  // 不可以影响别人的事务
                     *  sequenceEntity = this.GetSequenceByLock(fullName, defaultSequence);
                     *  if (this.ReturnStatusCode == StatusCode.LockOK.ToString())
                     *  {
                     *      this.ReturnStatusCode = this.UpdateSequence(fullName) > 0 ? StatusCode.LockOK.ToString() : StatusCode.CanNotLock.ToString();
                     *  }
                     * }
                     * else
                     * {
                     *  // 开始事务
                     *  IDbTransaction dbTransaction = DBProvider.BeginTransaction();
                     *  try
                     *  {
                     *      this.ReturnStatusCode = StatusCode.CanNotLock.ToString();
                     *      sequenceEntity = this.GetSequenceByLock(fullName, defaultSequence);
                     *      if (this.ReturnStatusCode == StatusCode.LockOK.ToString())
                     *      {
                     *          this.ReturnStatusCode = StatusCode.CanNotLock.ToString();
                     *          if (this.UpdateSequence(fullName) > 0)
                     *          {
                     *              // 提交事务
                     *              dbTransaction.Commit();
                     *              this.ReturnStatusCode = StatusCode.LockOK.ToString();
                     *          }
                     *          else
                     *          {
                     *              // 回滚事务
                     *              dbTransaction.Rollback();
                     *          }
                     *      }
                     *      else
                     *      {
                     *          // 回滚事务
                     *          dbTransaction.Rollback();
                     *      }
                     *  }
                     *  catch (System.Exception ex)
                     *  {
                     *      System.Console.WriteLine(ex);
                     *      // 回滚事务
                     *      dbTransaction.Rollback();
                     *      this.ReturnStatusCode = StatusCode.CanNotLock.ToString();
                     *  }
                     * }
                     */
                    break;
                }
            }

            // 写入调试信息
            #if (DEBUG)
            int milliEnd = Environment.TickCount;
            Trace.WriteLine(DateTime.Now.ToString(SystemInfo.TimeFormat) + " Ticks: " + TimeSpan.FromMilliseconds(milliEnd - milliStart).ToString() + " :End: " + MethodBase.GetCurrentMethod().ReflectedType.Name + "." + MethodBase.GetCurrentMethod().Name);
            #endif

            return(GetSequence(sequenceEntity));
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 获取倒序序列号
        /// </summary>
        /// <param name="fullName">序列名称</param>
        /// <param name="defaultSequence">默认序列值</param>
        /// <returns>序列号</returns>
        public string GetReduction(string fullName, int defaultSequence)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = Environment.TickCount;
            Trace.WriteLine(DateTime.Now.ToString(SystemInfo.TimeFormat) + " :Begin: " + MethodBase.GetCurrentMethod().ReflectedType.Name + "." + MethodBase.GetCurrentMethod().Name);
            #endif

            CiSequenceEntity sequenceEntity = null;

            // 这里用锁的机制,提高并发控制能力
            lock (SequenceLock)
            {
                this.DefaultReduction = defaultSequence;
                this.DefaultSequence  = defaultSequence + 1;

                switch (DBProvider.CurrentDbType)
                {
                case CurrentDbType.Access:
                case CurrentDbType.MySql:
                case CurrentDbType.SqlServer:
                    sequenceEntity = GetEntityByAdd(fullName);
                    this.UpdateReduction(fullName);
                    break;

                case CurrentDbType.Oracle:
                    if (DBProvider.InTransaction)
                    {
                        // 不可以影响别人的事务
                        sequenceEntity = this.GetSequenceByLock(fullName, defaultSequence);
                        if (this.ReturnStatusCode == StatusCode.LockOK.ToString())
                        {
                            this.ReturnStatusCode = this.UpdateReduction(fullName) > 0 ? StatusCode.LockOK.ToString() : StatusCode.CanNotLock.ToString();
                        }
                    }
                    else
                    {
                        // 这里加锁机制。
                        try
                        {
                            // 开始事务
                            DBProvider.BeginTransaction();
                            this.ReturnStatusCode = StatusCode.CanNotLock.ToString();
                            sequenceEntity        = this.GetSequenceByLock(fullName, defaultSequence);
                            if (this.ReturnStatusCode == StatusCode.LockOK.ToString())
                            {
                                this.ReturnStatusCode = StatusCode.CanNotLock.ToString();
                                if (this.UpdateReduction(fullName) > 0)
                                {
                                    // 提交事务
                                    DBProvider.CommitTransaction();
                                    this.ReturnStatusCode = StatusCode.LockOK.ToString();
                                }
                                else
                                {
                                    // 回滚事务
                                    DBProvider.RollbackTransaction();
                                }
                            }
                            else
                            {
                                // 回滚事务
                                DBProvider.RollbackTransaction();
                            }
                        }
                        catch
                        {
                            // 回滚事务
                            DBProvider.RollbackTransaction();
                            this.ReturnStatusCode = StatusCode.CanNotLock.ToString();
                        }
                    }
                    break;
                }
            }

            // 写入调试信息
            #if (DEBUG)
            int milliEnd = Environment.TickCount;
            Trace.WriteLine(DateTime.Now.ToString(SystemInfo.TimeFormat) + " Ticks: " + TimeSpan.FromMilliseconds(milliEnd - milliStart).ToString() + " :End: " + MethodBase.GetCurrentMethod().ReflectedType.Name + "." + MethodBase.GetCurrentMethod().Name);
            #endif

            return(GetReduction(sequenceEntity));
        }