View Javadoc

1   package uk.co.concise.maven.hdc.model;
2   
3   import java.util.HashSet;
4   import java.util.Set;
5   
6   
7   /***
8    * A label in a chart. A label is associated with measure points
9    * for that label.
10   * 
11   * @author martenssonb
12   * 
13   * @hibernate.class
14   *             table = "LABELS"
15   */
16  public class Label {
17      
18      private long id;
19      private String text;
20      private Chart chart;
21      private Set points = new HashSet();
22      
23      /***
24       * Returns the unique id.
25       * 
26       * @hibernate.id
27       *      column = "id"
28       *      generator-class = "native"
29       *      unsaved-value = "0"
30       *  
31       * @return Returns the id.
32       */
33      public long getId() {
34          return id;
35      }
36      
37      /***
38       * Sets the unique id. For hibernate.
39       * @param id
40       *            The id to set.
41       */
42      private void setId(long id) {
43          this.id = id;
44      }
45      
46      /***
47       * The label text.
48       * @return Returns the label text..
49       * 
50       * @hibernate.property not-null="true"
51       */
52      public String getText() {
53          return text;
54      }
55      /***
56       * The label text.
57       * @param label the label text.
58       */
59      public void setText(String label) {
60          this.text = label;
61      }
62      /***
63       * @return Returns the chart.
64       * 
65       * @hibernate.many-to-one column="chart_id"
66       */
67      public Chart getChart() {
68          return chart;
69      }
70      /***
71       * @param chart The chart to set.
72       */
73      public void setChart(Chart chart) {
74          this.chart = chart;
75      }
76      
77      /***
78       * @return Returns the points.
79       * 
80       * @hibernate.set
81       *       lazy="false"
82       *       cascade="save-update"
83       *       inverse="true"
84       * 
85       * @hibernate.collection-key
86       *       column="label_id"
87       * 
88       * @hibernate.collection-one-to-many
89       *       class="uk.co.concise.maven.hdc.model.Point"
90       *  
91       */
92      public Set getPoints() {
93          return points;
94      }
95      
96      /***
97       * @param points The points to set.
98       */
99      public void setPoints(Set points) {
100         this.points = points;
101     }
102 }