private static SameContainerItemAndContainerSnapshotCollection GetInsertData(string containerID, string containerSchemaType, SameContainerItemAndContainerSnapshotCollection existedData, SchemaObjectCollection items)
        {
            SameContainerItemAndContainerSnapshotCollection newInfo = new SameContainerItemAndContainerSnapshotCollection();

            foreach (SchemaObjectBase item in items)
            {
                if (existedData.ContainsKey(item.ID) == false && newInfo.ContainsKey(item.ID) == false)
                {
                    ItemAndContainerSnapshot uacs = new ItemAndContainerSnapshot();

                    uacs.ContainerID         = containerID;
                    uacs.ContainerSchemaType = containerSchemaType;
                    uacs.ItemID         = item.ID;
                    uacs.ItemSchemaType = item.SchemaType;
                    uacs.Status         = SchemaObjectStatus.Normal;

                    newInfo.Add(uacs);
                }
            }

            return(newInfo);
        }
        /// <summary>
        /// 根据Container来加载ItemAndContainerSnapshot的信息
        /// </summary>
        /// <param name="containerID"></param>
        /// <param name="timePoint"></param>
        /// <returns></returns>
        public SameContainerItemAndContainerSnapshotCollection LoadByContainerID(string containerID, DateTime timePoint)
        {
            containerID.CheckStringIsNullOrEmpty("containerID");

            ConnectiveSqlClauseCollection timePointBuilder = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder(timePoint);

            WhereSqlClauseBuilder whereBuilder = new WhereSqlClauseBuilder();

            whereBuilder.AppendItem("ContainerID", containerID);

            ConnectiveSqlClauseCollection connectiveBuilder = new ConnectiveSqlClauseCollection(whereBuilder, timePointBuilder);

            string sql = string.Format("SELECT * FROM {0} WHERE {1}",
                                       this.GetLoadingTableName(timePoint), connectiveBuilder.ToSqlString(TSqlBuilder.Instance));

            SameContainerItemAndContainerSnapshotCollection result = new SameContainerItemAndContainerSnapshotCollection();

            using (DbContext context = DbContext.GetContext(this.GetConnectionName()))
            {
                using (IDataReader reader = DbHelper.RunSqlReturnDR(sql, this.GetConnectionName()))
                {
                    while (reader.Read())
                    {
                        ItemAndContainerSnapshot item = new ItemAndContainerSnapshot();

                        ORMapping.DataReaderToObject(reader, item);

                        if (result.ContainsKey(item.ItemID) == false)
                        {
                            result.Add(item);
                        }
                    }
                }
            }

            return(result);
        }
		private static SameContainerItemAndContainerSnapshotCollection GetInsertData(string containerID, string containerSchemaType, SameContainerItemAndContainerSnapshotCollection existedData, SchemaObjectCollection items)
		{
			SameContainerItemAndContainerSnapshotCollection newInfo = new SameContainerItemAndContainerSnapshotCollection();

			foreach (SchemaObjectBase item in items)
			{
				if (existedData.ContainsKey(item.ID) == false && newInfo.ContainsKey(item.ID) == false)
				{
					ItemAndContainerSnapshot uacs = new ItemAndContainerSnapshot();

					uacs.ContainerID = containerID;
					uacs.ContainerSchemaType = containerSchemaType;
					uacs.ItemID = item.ID;
					uacs.ItemSchemaType = item.SchemaType;
					uacs.Status = SchemaObjectStatus.Normal;

					newInfo.Add(uacs);
				}
			}

			return newInfo;
		}
		/// <summary>
		/// 根据Container来加载ItemAndContainerSnapshot的信息
		/// </summary>
		/// <param name="containerID"></param>
		/// <param name="timePoint"></param>
		/// <returns></returns>
		public SameContainerItemAndContainerSnapshotCollection LoadByContainerID(string containerID, DateTime timePoint)
		{
			containerID.CheckStringIsNullOrEmpty("containerID");

			ConnectiveSqlClauseCollection timePointBuilder = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder(timePoint);

			WhereSqlClauseBuilder whereBuilder = new WhereSqlClauseBuilder();

			whereBuilder.AppendItem("ContainerID", containerID);

			ConnectiveSqlClauseCollection connectiveBuilder = new ConnectiveSqlClauseCollection(whereBuilder, timePointBuilder);

			string sql = string.Format("SELECT * FROM {0} WHERE {1}",
				this.GetLoadingTableName(timePoint), connectiveBuilder.ToSqlString(TSqlBuilder.Instance));

			SameContainerItemAndContainerSnapshotCollection result = new SameContainerItemAndContainerSnapshotCollection();

			using (DbContext context = DbContext.GetContext(this.GetConnectionName()))
			{
				using (IDataReader reader = DbHelper.RunSqlReturnDR(sql, this.GetConnectionName()))
				{
					while (reader.Read())
					{
						ItemAndContainerSnapshot item = new ItemAndContainerSnapshot();

						ORMapping.DataReaderToObject(reader, item);

						if (result.ContainsKey(item.ItemID) == false)
							result.Add(item);
					}
				}
			}

			return result;
		}