View Javadoc

1   /*
2    * Sonar, entreprise quality control tool.
3    * Copyright (C) 2007-2008 Hortis-GRC SA
4    * mailto:be_agile HAT hortis DOT ch
5    *
6    * Sonar is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License as published by the Free Software Foundation; either
9    * version 3 of the License, or (at your option) any later version.
10   *
11   * Sonar is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   * Lesser General Public License for more details.
15   *
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with {library}; if not, write to the Free Software
18   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
19   */
20  package ch.hortis.sonar.model;
21  
22  import javax.persistence.Column;
23  import javax.persistence.Entity;
24  import javax.persistence.Id;
25  import javax.persistence.NamedQueries;
26  import javax.persistence.NamedQuery;
27  import javax.persistence.Table;
28  
29  @Entity
30  @Table(name = "properties")
31  @NamedQueries(
32      {@NamedQuery(name = Property.SQL_SELECT_PROPERTY, query =
33          "SELECT p FROM Property p WHERE p.key = :property_key")}
34  )
35  public class Property {
36    public final static String SQL_SELECT_PROPERTY = "Property.selectProperty";
37    
38    public final static String TENDENCY_DEPTH = "tendency.depth";
39    
40    @Id
41    @Column(name = "prop_key", updatable = true, nullable = false)
42    private String key;
43  
44    @Column(name = "prop_value", updatable = true, nullable = false)
45    private String value;
46  
47    public Property(String key, String value) {
48      this.key = key;
49      this.value = value;
50    }
51  
52    public Property() {
53    }
54  
55    public String getKey() {
56      return key;
57    }
58  
59    public void setKey(String key) {
60      this.key = key;
61    }
62  
63    public String getValue() {
64      return value;
65    }
66  
67    public void setValue(String value) {
68      this.value = value;
69    }
70  }