Ejemplo n.º 1
0
        // no statement building
#else
        public override bool BuildStatement(DBStatementBuilder builder)
        {
            builder.BeginCreate(DBSchemaTypes.ForeignKey, string.Empty, this.Name, string.Empty, false);


            BuildColumnListStatement(builder, this.TableColumns);

            builder.BeginReferences(this.ReferenceOwner, this.ReferenceName);

            BuildColumnListStatement(builder, this.ReferenceColumns);

            builder.EndReferences(this.ReferenceOwner, this.ReferenceName);

            if (this.OnDeleteAction != DBFKAction.Undefined || this.OnUpdateAction != DBFKAction.Undefined)
            {
                builder.BeginForeignKeyUpdateActions();

                if (this.OnDeleteAction != DBFKAction.Undefined)
                {
                    builder.WriteDeleteAction(this.OnDeleteAction);
                }
                if (this.OnUpdateAction != DBFKAction.Undefined)
                {
                    builder.WriteUpdateAction(this.OnUpdateAction);
                }

                builder.EndForeignKeyUpdateActions();
            }

            builder.EndCreate(DBSchemaTypes.ForeignKey, false);
            return(true);
        }