View Javadoc
1   /*
2    * Copyright (c) 2002-2017, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.apilocannonces.business;
35  
36  import java.io.Serializable;
37  
38  import javax.persistence.Cacheable;
39  import javax.persistence.Column;
40  import javax.persistence.Entity;
41  import javax.persistence.FetchType;
42  import javax.persistence.Id;
43  import javax.persistence.JoinColumn;
44  import javax.persistence.ManyToOne;
45  import javax.persistence.Table;
46  import javax.xml.bind.annotation.XmlElement;
47  import javax.xml.bind.annotation.XmlRootElement;
48  import javax.xml.bind.annotation.XmlTransient;
49  
50  import org.hibernate.annotations.Cache;
51  import org.hibernate.annotations.CacheConcurrencyStrategy;
52  
53  /**
54   * Class ElementConfort
55   * 
56   * ElementConfort are link to any Logement with the table
57   * l24t_t_elementdeconfort_x_t_logement
58   */
59  @Entity
60  @Table( name = "l24t_t_elementdeconfort" )
61  @Cacheable
62  @Cache( usage = CacheConcurrencyStrategy.READ_WRITE )
63  @XmlRootElement
64  public class ElementConfort implements Serializable
65  {
66      private static final long serialVersionUID = 1L;
67      @Id
68      @Column( name = "t_elementdeconfort_id" )
69      @XmlElement( name = "id" )
70      private String _id;
71      @Column( name = "libelle" )
72      @XmlElement( name = "libelle" )
73      private String _libelle;
74      @ManyToOne( fetch = FetchType.EAGER, optional = true )
75      @JoinColumn( name = "t_categorieelementdeconfort_id" )
76      @XmlElement( name = "categorie" )
77      private CategorieElementConfort _categorieElementConfort;
78  
79      @Override
80      public String toString( )
81      {
82          return _libelle;
83      }
84  
85      /**
86       * @param libelle
87       *            the libelle to set
88       */
89      public void setLibelle( String libelle )
90      {
91          this._libelle = libelle;
92      }
93  
94      /**
95       * @return the libelle
96       */
97      public String getLibelle( )
98      {
99          return _libelle;
100     }
101 
102     /**
103      * @param id
104      *            the id to set
105      */
106     public void setId( String id )
107     {
108         this._id = id;
109     }
110 
111     /**
112      * @return the id
113      */
114     public String getId( )
115     {
116         return _id;
117     }
118 
119     /**
120      * Modification de la categorie
121      * 
122      * @param categorie
123      *            categorie
124      */
125     public void setCategorieElementConfort( CategorieElementConfort categorie )
126     {
127         this._categorieElementConfort = categorie;
128     }
129 
130     /**
131      * Acces à la categorie
132      * 
133      * @return categorie
134      */
135     @XmlTransient
136     public CategorieElementConfort getCategorieElementConfort( )
137     {
138         return _categorieElementConfort;
139     }
140 
141 }