Пример #1
0
        protected void CreateIndex(Table table, IEnumerable<Column> columns)
        {
            string indexName = string.Format("IX_{0}{1}", table.Name,
                StringUtilities.Combine(columns, "", delegate(Column c) { return c.Name; }));

            CollectionUtils.ForEach(columns,
                delegate(Column c) { table.GetOrCreateIndex(indexName).AddColumn(c); });
        }
Пример #2
0
		private static void BindIndex(string indexAttribute, Table table, Column column)
		{
			if (indexAttribute != null && table != null)
			{
				var tokens = indexAttribute.Split(',');
				System.Array.ForEach(tokens, t => table.GetOrCreateIndex(t.Trim()).AddColumn(column));
			}
		}
Пример #3
0
 protected static void BindIndex(XmlAttribute indexAttribute, Table table, Column column)
 {
     if (indexAttribute != null && table != null)
     {
         StringTokenizer tokens = new StringTokenizer(indexAttribute.Value, ", ");
         foreach (string token in tokens)
             table.GetOrCreateIndex(token).AddColumn(column);
     }
 }
Пример #4
0
		protected static void BindIndex(string indexAttribute, Table table, Column column)
		{
			if (indexAttribute != null && table != null)
			{
				var tokens = new StringTokenizer(indexAttribute, ",", false);
				foreach (string token in tokens)
					table.GetOrCreateIndex(token.Trim()).AddColumn(column);
			}
		}