1 | package de.uka.ipd.sdq.sensorframework.entities.base; |
2 | |
3 | @javax.persistence.Entity |
4 | @javax.persistence.Table(name = "EXPERIMENT") |
5 | public abstract class AbstractExperiment |
6 | |
7 | implements de.uka.ipd.sdq.sensorframework.entities.Experiment |
8 | |
9 | { |
10 | |
11 | protected transient de.uka.ipd.sdq.sensorframework.entities.dao.IDAOFactory myDAOFactory = null; |
12 | |
13 | public AbstractExperiment( |
14 | de.uka.ipd.sdq.sensorframework.entities.dao.IDAOFactory myFactory) { |
15 | this.myDAOFactory = myFactory; |
16 | } |
17 | |
18 | /* Getter and Setter for Properties with cardinality 0..1 or 1 which are not a composition */ |
19 | |
20 | @javax.persistence.Id |
21 | @javax.persistence.Column(name = "EXPERIMENTID") |
22 | @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.IDENTITY) |
23 | private long m_experimentID; |
24 | |
25 | public long getExperimentID() { |
26 | return m_experimentID; |
27 | } |
28 | |
29 | public void setExperimentID(long value) { |
30 | this.m_experimentID = value; |
31 | }; |
32 | |
33 | @javax.persistence.Column(name = "EXPERIMENTNAME") |
34 | private String m_experimentName; |
35 | |
36 | public String getExperimentName() { |
37 | return m_experimentName; |
38 | } |
39 | |
40 | public void setExperimentName(String value) { |
41 | this.m_experimentName = value; |
42 | } |
43 | |
44 | /* Getter and Setter for Properties with cardinality 0..1 or 1 which are a composition */ |
45 | |
46 | /* Getter and Setter for Properties with cardinality 0..* which are not a composition */ |
47 | |
48 | /* Getter and Setter for Properties with cardinality 0..* which are a composition */ |
49 | |
50 | @javax.persistence.OneToMany(cascade = javax.persistence.CascadeType.ALL) |
51 | @javax.persistence.JoinTable(name = "Experiment_sensors", joinColumns = { @javax.persistence.JoinColumn(name = "EXPERIMENT_ID") }, inverseJoinColumns = { @javax.persistence.JoinColumn(name = "SENSOR_ID") }) |
52 | private java.util.Collection<de.uka.ipd.sdq.sensorframework.entities.Sensor> m_sensors = new java.util.ArrayList<de.uka.ipd.sdq.sensorframework.entities.Sensor>(); |
53 | |
54 | public de.uka.ipd.sdq.sensorframework.entities.StateSensor addStateSensor( |
55 | |
56 | de.uka.ipd.sdq.sensorframework.entities.State p_initialstate |
57 | |
58 | , |
59 | |
60 | String p_sensorname) { |
61 | |
62 | de.uka.ipd.sdq.sensorframework.entities.StateSensor result = myDAOFactory |
63 | .createSensorDAO().addStateSensor( |
64 | |
65 | p_initialstate |
66 | |
67 | , |
68 | |
69 | p_sensorname); |
70 | |
71 | m_sensors.add(result); |
72 | return result; |
73 | } |
74 | |
75 | public de.uka.ipd.sdq.sensorframework.entities.TimeSpanSensor addTimeSpanSensor( |
76 | |
77 | String p_sensorname) { |
78 | |
79 | de.uka.ipd.sdq.sensorframework.entities.TimeSpanSensor result = myDAOFactory |
80 | .createSensorDAO().addTimeSpanSensor( |
81 | |
82 | p_sensorname); |
83 | |
84 | m_sensors.add(result); |
85 | return result; |
86 | } |
87 | |
88 | public de.uka.ipd.sdq.sensorframework.entities.ScalabilitySensor addScalabilitySensor( |
89 | |
90 | String p_sensorname) { |
91 | |
92 | de.uka.ipd.sdq.sensorframework.entities.ScalabilitySensor result = myDAOFactory |
93 | .createSensorDAO().addScalabilitySensor( |
94 | |
95 | p_sensorname); |
96 | |
97 | m_sensors.add(result); |
98 | return result; |
99 | } |
100 | |
101 | public void addSensor(de.uka.ipd.sdq.sensorframework.entities.Sensor value) { |
102 | this.m_sensors.add(value); |
103 | } |
104 | |
105 | public java.util.Collection<de.uka.ipd.sdq.sensorframework.entities.Sensor> getSensors() { |
106 | return this.m_sensors; |
107 | }; |
108 | |
109 | @javax.persistence.OneToMany(cascade = javax.persistence.CascadeType.ALL) |
110 | @javax.persistence.JoinTable(name = "Experiment_experimentRuns", joinColumns = { @javax.persistence.JoinColumn(name = "EXPERIMENT_ID") }, inverseJoinColumns = { @javax.persistence.JoinColumn(name = "EXPERIMENTRUN_ID") }) |
111 | private java.util.Collection<de.uka.ipd.sdq.sensorframework.entities.ExperimentRun> m_experimentRuns = new java.util.ArrayList<de.uka.ipd.sdq.sensorframework.entities.ExperimentRun>(); |
112 | |
113 | public de.uka.ipd.sdq.sensorframework.entities.ExperimentRun addExperimentRun( |
114 | |
115 | String p_experimentdatetime) { |
116 | |
117 | de.uka.ipd.sdq.sensorframework.entities.ExperimentRun result = myDAOFactory |
118 | .createExperimentRunDAO().addExperimentRun( |
119 | |
120 | p_experimentdatetime); |
121 | |
122 | m_experimentRuns.add(result); |
123 | return result; |
124 | } |
125 | |
126 | public de.uka.ipd.sdq.sensorframework.entities.ExperimentRun addScalabilityExperimentRun( |
127 | |
128 | String p_experimentdatetime) { |
129 | |
130 | de.uka.ipd.sdq.sensorframework.entities.ExperimentRun result = myDAOFactory |
131 | .createExperimentRunDAO().addScalabilityExperimentRun( |
132 | |
133 | p_experimentdatetime); |
134 | |
135 | m_experimentRuns.add(result); |
136 | return result; |
137 | } |
138 | |
139 | public void addExperimentRun( |
140 | de.uka.ipd.sdq.sensorframework.entities.ExperimentRun value) { |
141 | this.m_experimentRuns.add(value); |
142 | } |
143 | |
144 | public java.util.Collection<de.uka.ipd.sdq.sensorframework.entities.ExperimentRun> getExperimentRuns() { |
145 | return this.m_experimentRuns; |
146 | } |
147 | |
148 | /* Abstract Operations */ |
149 | |
150 | } |