View Javadoc

1   package org.lsst.ccs.localdb.statusdb.model;
2   
3   import java.io.Serializable;
4   
5   import javax.persistence.Column;
6   import javax.persistence.Entity;
7   import javax.persistence.GeneratedValue;
8   import javax.persistence.GenerationType;
9   import javax.persistence.Id;
10  import javax.persistence.ManyToOne;
11  import javax.persistence.Table;
12  
13  import org.hibernate.annotations.Index;
14  
15  @Entity
16  @Table(name = "rawdata")
17  @org.hibernate.annotations.Table(appliesTo = "rawdata", indexes = { @Index(name = "ts", columnNames = {
18          "descr_id", "tstampmills" }) })
19  
20  
21  public class RawData implements Serializable {
22  
23      private static final long serialVersionUID = 5996448023570084719L;
24      private long id; // do we need this? Perhaps for filter, or whatever
25      private DataDesc descr;
26      private long tstamp;
27      private Double doubleData;
28      private String stringData;
29  
30      /**
31       * @return the id
32       */
33      @Id
34      @GeneratedValue(strategy = GenerationType.AUTO)
35      public long getId() {
36          return id;
37      }
38  
39      /**
40       * @param id
41       *            the id to set
42       */
43      public void setId(long id) {
44          this.id = id;
45      }
46  
47      /**
48       * @return the descr
49       */
50      @ManyToOne
51      public DataDesc getDescr() {
52          return descr;
53      }
54  
55      /**
56       * @param descr
57       *            the descr to set
58       */
59      public void setDescr(DataDesc descr) {
60          this.descr = descr;
61      }
62  
63      /**
64       * @return the tstamp
65       */
66      @Column(name = "tstampmills")
67      public long getTstamp() {
68          return tstamp;
69      }
70  
71      /**
72       * @param tstamp
73       *            the tstamp to set
74       */
75      public void setTstamp(long tstamp) {
76          this.tstamp = tstamp;
77      }
78  
79      /**
80       * @return the doubleData
81       */
82      public Double getDoubleData() {
83          return doubleData;
84      }
85  
86      /**
87       * @param doubleData
88       *            the doubleData to set
89       */
90      public void setDoubleData(Double doubleData) {
91          this.doubleData = doubleData;
92      }
93  
94      /**
95       * @return the stringData
96       */
97      public String getStringData() {
98          return stringData;
99      }
100 
101     /**
102      * @param stringData
103      *            the stringData to set
104      */
105     public void setStringData(String stringData) {
106         this.stringData = stringData;
107     }
108     // public Integer intData; ??
109     // can be a keyword - example : temperature to retrieve all temperature data
110     // for one subsystem ?
111 }
112 // TODO description of derived data to be computed, and statistical data output,
113 // two tables.
114