Пример #1
0
 /// <summary>
 /// Marks attribute as foreign key
 /// </summary>
 /// <param name="attr">Attribute IR object</param>
 /// <param name="tableRef">Referred table</param>
 /// <param name="keyRef">effered key</param>
 private void SetForeignKey(IR.TableAttribute attr, string tableRef, string keyRef)
 {
     if (attr != null)
     {
         attr.ForeignKey      = true;
         attr.ForeignTableRef = tableRef;
         attr.ForeignKeyRef   = keyRef;
     }
 }
Пример #2
0
    /// <summary>
    /// Marks given attribute of current table as primary key
    /// </summary>
    /// <param name="attrName">Attribute name</param>
    private void SetPrimaryKey(string attrName)
    {
        IR.TableAttribute attr = FindAttribute(attrName);

        if (attr != null)
        {
            attr.PrimaryKey = true;
        }
    }
Пример #3
0
 /// <summary>
 /// Marks attribute given by name of specified table as foreign key
 /// </summary>
 /// <param name="table">Table IR object</param>
 /// <param name="attrName">Attribute name</param>
 /// <param name="tableRef">Referred table</param>
 /// <param name="keyRef">Reffered key</param>
 private void SetForeignKey(IR.Table table, string attrName, string tableRef, string keyRef)
 {
     if (table != null)
     {
         IR.TableAttribute attr = FindAttribute(attrName, table);
         if (attr != null)
         {
             SetForeignKey(attr, tableRef, keyRef);
         }
     }
 }
Пример #4
0
 /// <summary>
 /// Creates new IR table attribute representation
 /// </summary>
 private void CreateAttribute()
 {
     IR.TableAttribute newAttr = new IR.TableAttribute();
     CurrentTable().Attribues.Add(newAttr);
 }