protected RelationshipAttribute(string foreignKey, string inverseForeignKey, string inverseProperty, OnDeleteAction onDeleteAction) { InverseForeignKey = inverseForeignKey; InverseProperty = inverseProperty; ForeignKey = foreignKey; OnDeleteAction = onDeleteAction; }
public void AddFK(IDataContext db, string columnName, string refTable, OnDeleteAction act) { if (db == null) { throw new ArgumentNullException("session"); } if (string.IsNullOrEmpty(columnName)) { throw new ArgumentNullException("columnName"); } if (!NamingRule.IsValidSqlName(columnName)) { throw new ArgumentOutOfRangeException("columnName"); } if (string.IsNullOrEmpty(refTable)) { throw new ArgumentNullException("refTable"); } var onDelete = OnDeleteMapping[act]; var fkName = this.GenerateFkName(columnName); var sql = string.Format(CultureInfo.InvariantCulture, "alter table \"{0}\" add constraint \"{1}\" foreign key (\"{2}\") references \"{3}\" on delete {4}", this.Name, fkName, columnName, refTable, onDelete); db.Execute(SqlString.Parse(sql)); }
public void OnGUI() { _scroll = BeginScrollView(_scroll); switch (_inspectionObject) { case InputGroup group: group.groupName = NameField(group.groupName); if (DeleteButton()) { OnDeleteGroup.Invoke(group); } break; case InspectorInputAction action: action.action.actionName = NameField(action.action.actionName); DisplayKeys(action.action); Space(); if (DeleteButton()) { OnDeleteAction.Invoke(action); } break; case InspectorInputAxis axis: axis.axis.axisName = NameField(axis.axis.axisName); EditorChangeChecker.BeginChangeCheck(InputMapWindow.SetMapDirty); axis.axis.positiveAction = TextField("Positive", axis.axis.positiveAction); axis.axis.negativeAction = TextField("Negative", axis.axis.negativeAction); EditorChangeChecker.EndChangeCheckAndCleanup(); if (DeleteButton()) { OnDeleteAxis.Invoke(axis); } break; case InputAction _: HelpBox(new GUIContent($"Use '{nameof(InspectorInputAction)}' instead of '{nameof(InputAction)}'!")); break; case InputAxis _: HelpBox(new GUIContent($"Use '{nameof(InspectorInputAxis)}' instead of '{nameof(InputAxis)}'!")); break; } EndScrollView(); if (OnNextRepaint != null && Event.current.type == EventType.Repaint) { OnNextRepaint?.Invoke(); OnNextRepaint = null; InputMapWindow.GetEditorWindow().Repaint(); } }
protected override void InvokeInternal(CommandProcessorContext cpc) { // if the OnDeleteAction already exists then only change the action value _createdAction = _parentEnd.OnDeleteAction; if (_createdAction == null) { _createdAction = new OnDeleteAction(_parentEnd, null); _parentEnd.OnDeleteAction = _createdAction; } _createdAction.Action.Value = _action; XmlModelHelper.NormalizeAndResolve(_createdAction); }
public void OnDelete(OnDeleteAction deleteAction) { switch (deleteAction) { case OnDeleteAction.NoAction: mapping.ondelete = HbmOndelete.Noaction; break; case OnDeleteAction.Cascade: mapping.ondelete = HbmOndelete.Cascade; break; } }
public virtual string GetOnDeleteActionValue(OnDeleteAction onDeleteAction) { switch (onDeleteAction) { default: case OnDeleteAction.NoAction: return("NO ACTION"); case OnDeleteAction.Cascade: return("CASCADE"); case OnDeleteAction.SetNull: return("SET NULL"); case OnDeleteAction.SetDefault: return("SET DEFAULT"); } }
public ManyToOneAttribute(string foreignKey = null, string inverseProperty = null, OnDeleteAction onDeleteAction = OnDeleteAction.None) : base(foreignKey, null, inverseProperty, onDeleteAction) { }
public DatabaseTableColumn SetAsForeignKey(string tableName, string columnName, OnDeleteAction onDeleteAction = OnDeleteAction.NoAction) { DataConstraints |= DataConstraint.ForeignKey; ForeignKeyReference = new GenericTriple <string, string, OnDeleteAction>(tableName, columnName, onDeleteAction); return(this); }
public void OnDelete(OnDeleteAction deleteAction) { CustomizersHolder.AddCustomizer(typeof(TEntity), (IJoinAttributesMapper m) => m.Key(x => x.OnDelete(deleteAction))); }
public ManyToManyAttribute(Type intermediateType, string inverseForeignKey = null, string inverseProperty = null, OnDeleteAction onDeleteAction = OnDeleteAction.None) : base(null, inverseForeignKey, inverseProperty, onDeleteAction) { IntermediateType = intermediateType; }
public OneToManyAttribute(string inverseForeignKey = null, string inverseProperty = null, OnDeleteAction onDeleteAction = OnDeleteAction.None) : base(null, inverseForeignKey, inverseProperty, onDeleteAction) { }
public OneToOneAttribute(string foreignKey = null, string inverseProperty = null, OnDeleteAction onDeleteAction = OnDeleteAction.None) : base(foreignKey, null, inverseProperty, onDeleteAction) { }
public void OnDelete(OnDeleteAction deleteAction) { CustomizersHolder.AddCustomizer(propertyPath, (ICollectionPropertiesMapper m) => m.Key(x => x.OnDelete(deleteAction))); }
public IField OnDelete(OnDeleteAction act) { this.OnDeleteAction = act; return(this); }
public void RaiseOnDeleteAction() => OnDeleteAction?.Invoke(this, new EventArgs());