View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
4   */
5   
6   package com.hack23.cia.model.application.impl.common;
7   
8   import javax.persistence.DiscriminatorValue;
9   import javax.persistence.Entity;
10  import javax.persistence.EnumType;
11  import javax.persistence.Enumerated;
12  import javax.persistence.Lob;
13  import javax.persistence.ManyToOne;
14  
15  import org.hibernate.annotations.Cache;
16  import org.hibernate.annotations.CacheConcurrencyStrategy;
17  
18  import com.hack23.cia.model.core.impl.AbstractResource;
19  
20  /***
21   * The Class LanguageContent.
22   */
23  @Entity
24  @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
25  @DiscriminatorValue("LanguageContent")
26  public class LanguageContent extends AbstractResource {
27  
28      /***
29       * The Enum LanguageContentType.
30       */
31      public enum LanguageContentType {
32  
33          /*** The Agency. */
34          Agency,
35  
36          /*** The Portal. */
37          Portal
38      }
39  
40      /*** The Constant serialVersionUID. */
41      private static final long serialVersionUID = 1L;
42  
43      /*** The content. */
44      private String content;
45  
46      /*** The content property name. */
47      private String contentPropertyName;
48  
49      /*** The description. */
50      private String description;
51  
52      /*** The language. */
53      private Language language;
54  
55      /*** The language content type. */
56      private LanguageContentType languageContentType;
57  
58      /***
59       * Instantiates a new language content.
60       */
61      public LanguageContent() {
62          super();
63          setResourceType(ResourceType.LanguageContent);
64      }
65  
66      /***
67       * Gets the content.
68       *
69       * @return the content
70       */
71      @Lob
72      public String getContent() {
73          return content;
74      }
75  
76      /***
77       * Gets the content property name.
78       *
79       * @return the content property name
80       */
81      public String getContentPropertyName() {
82          return contentPropertyName;
83      }
84  
85      /***
86       * Gets the description.
87       *
88       * @return the description
89       */
90      public String getDescription() {
91          return description;
92      }
93  
94      /***
95       * Gets the language.
96       *
97       * @return the language
98       */
99      @ManyToOne
100     public Language getLanguage() {
101         return language;
102     }
103 
104     /***
105      * Gets the language content type.
106      *
107      * @return the language content type
108      */
109     @Enumerated(EnumType.STRING)
110     public LanguageContentType getLanguageContentType() {
111         return languageContentType;
112     }
113 
114     /***
115      * Sets the content.
116      *
117      * @param content the new content
118      */
119     public void setContent(final String content) {
120         this.content = content;
121     }
122 
123     /***
124      * Sets the content property name.
125      *
126      * @param contentPropertyName the new content property name
127      */
128     public void setContentPropertyName(final String contentPropertyName) {
129         this.contentPropertyName = contentPropertyName;
130     }
131 
132     /***
133      * Sets the description.
134      *
135      * @param description the new description
136      */
137     public void setDescription(final String description) {
138         this.description = description;
139     }
140 
141     /***
142      * Sets the language.
143      *
144      * @param language the new language
145      */
146     public void setLanguage(final Language language) {
147         this.language = language;
148     }
149 
150     /***
151      * Sets the language content type.
152      *
153      * @param languageContentType the new language content type
154      */
155     public void setLanguageContentType(final LanguageContentType languageContentType) {
156         this.languageContentType = languageContentType;
157     }
158 }