Last change
on this file since 2223 was
2223,
checked in by mkommend, 15 years ago
|
reintegrated branch new heuristic.modeling database backend (ticket #712)
|
File size:
1.2 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Data.Linq;
|
---|
4 | using System.Data.Linq.Mapping;
|
---|
5 | using System.Text;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.Modeling.Database.SQLServerCompact {
|
---|
8 | [Table(Name = "ModelData")]
|
---|
9 | public class ModelData {
|
---|
10 |
|
---|
11 | public ModelData() {
|
---|
12 | this.model = default(EntityRef<Model>);
|
---|
13 | }
|
---|
14 |
|
---|
15 | public ModelData(Model model, byte[] data)
|
---|
16 | : base() {
|
---|
17 | this.modelId = model.Id;
|
---|
18 | this.data = data;
|
---|
19 | }
|
---|
20 |
|
---|
21 |
|
---|
22 | private int modelId;
|
---|
23 | [Column(Storage = "modelId", IsPrimaryKey = true)]
|
---|
24 | public int ModelId {
|
---|
25 | get { return this.modelId; }
|
---|
26 | private set {
|
---|
27 | if (modelId != value) {
|
---|
28 | if (model.HasLoadedOrAssignedValue)
|
---|
29 | throw new ForeignKeyReferenceAlreadyHasValueException();
|
---|
30 | modelId = value;
|
---|
31 | }
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | private EntityRef<Model> model;
|
---|
36 | [Association(Storage = "model", ThisKey = "ModelId", OtherKey = "Id", IsForeignKey = true)]
|
---|
37 | public Model Model {
|
---|
38 | get { return model.Entity; }
|
---|
39 | }
|
---|
40 |
|
---|
41 | private byte[] data;
|
---|
42 | [Column(Storage = "data", DbType = "image", CanBeNull = false)]
|
---|
43 | public byte[] Data {
|
---|
44 | get { return this.data; }
|
---|
45 | private set { this.data = value; }
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.