Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/23/09 11:01:40 (15 years ago)
Author:
mkommend
Message:

implemented final prototyp of LinqToSql mapping (ticket #712)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.SQLiteBackend/3.2/InputVariable.cs

    r2178 r2179  
    1313    }
    1414
    15     public InputVariable(Model model, Variable variable) :base() {
    16       this.modelId = model.Id;
     15    public InputVariable(Model model, Variable variable)
     16      : base() {
    1717      this.model.Entity = model;
    18       this.variableId = variable.Id;
    1918      this.variable.Entity = variable;
    2019    }
    2120
    2221    private int variableId;
    23     [Column(Storage = "variableId", DbType = "Int not null", IsPrimaryKey = true)]
    24     public int TargetVariableId {
     22    [Column(Storage = "variableId", IsPrimaryKey = true)]
     23    public int VariableId {
    2524      get { return this.variableId; }
    2625      private set {
    2726        if (variableId != value) {
     27          if (variable.HasLoadedOrAssignedValue)
     28            throw new ForeignKeyReferenceAlreadyHasValueException();
    2829          variableId = value;
    2930        }
     
    3233
    3334    private EntityRef<Variable> variable;
    34     [Association(Storage="variable", ThisKey="variableId", OtherKey="Id", IsForeignKey=true)]
     35    [Association(Storage = "variable", ThisKey = "VariableId", OtherKey = "Id", IsForeignKey = true)]
    3536    public Variable Variable {
    3637      get { return variable.Entity; }
     
    3839
    3940    private int modelId;
    40     [Column(Storage = "modelId", DbType = "Int not null", IsPrimaryKey = true)]
     41    [Column(Storage = "modelId", IsPrimaryKey = true)]
    4142    public int ModelId {
    4243      get { return this.modelId; }
    4344      private set {
    4445        if (modelId != value) {
     46          if (model.HasLoadedOrAssignedValue)
     47            throw new ForeignKeyReferenceAlreadyHasValueException();
    4548          modelId = value;
    4649        }
     
    4952
    5053    private EntityRef<Model> model;
    51     [Association(Storage = "model", ThisKey = "modelId", OtherKey = "Id", IsForeignKey = true)]
     54    [Association(Storage = "model", ThisKey = "ModelId", OtherKey = "Id", IsForeignKey = true)]
    5255    public Model Model {
    5356      get { return model.Entity; }
Note: See TracChangeset for help on using the changeset viewer.