1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.expando.service.base;
21  
22  import com.liferay.counter.service.CounterLocalService;
23  import com.liferay.counter.service.CounterService;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.BeanReference;
28  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
29  import com.liferay.portal.service.ResourceLocalService;
30  import com.liferay.portal.service.ResourceService;
31  import com.liferay.portal.service.persistence.ResourceFinder;
32  import com.liferay.portal.service.persistence.ResourcePersistence;
33  import com.liferay.portal.util.PortalUtil;
34  
35  import com.liferay.portlet.expando.model.ExpandoColumn;
36  import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
37  import com.liferay.portlet.expando.service.ExpandoColumnService;
38  import com.liferay.portlet.expando.service.ExpandoRowLocalService;
39  import com.liferay.portlet.expando.service.ExpandoTableLocalService;
40  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
41  import com.liferay.portlet.expando.service.ExpandoValueService;
42  import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
43  import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
44  import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
45  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
46  
47  import java.util.List;
48  
49  /**
50   * <a href="ExpandoColumnLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
51   *
52   * @author Brian Wing Shun Chan
53   *
54   */
55  public abstract class ExpandoColumnLocalServiceBaseImpl
56      implements ExpandoColumnLocalService {
57      public ExpandoColumn addExpandoColumn(ExpandoColumn expandoColumn)
58          throws SystemException {
59          expandoColumn.setNew(true);
60  
61          return expandoColumnPersistence.update(expandoColumn, false);
62      }
63  
64      public ExpandoColumn createExpandoColumn(long columnId) {
65          return expandoColumnPersistence.create(columnId);
66      }
67  
68      public void deleteExpandoColumn(long columnId)
69          throws PortalException, SystemException {
70          expandoColumnPersistence.remove(columnId);
71      }
72  
73      public void deleteExpandoColumn(ExpandoColumn expandoColumn)
74          throws SystemException {
75          expandoColumnPersistence.remove(expandoColumn);
76      }
77  
78      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
79          throws SystemException {
80          return expandoColumnPersistence.findWithDynamicQuery(dynamicQuery);
81      }
82  
83      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
84          int end) throws SystemException {
85          return expandoColumnPersistence.findWithDynamicQuery(dynamicQuery,
86              start, end);
87      }
88  
89      public ExpandoColumn getExpandoColumn(long columnId)
90          throws PortalException, SystemException {
91          return expandoColumnPersistence.findByPrimaryKey(columnId);
92      }
93  
94      public List<ExpandoColumn> getExpandoColumns(int start, int end)
95          throws SystemException {
96          return expandoColumnPersistence.findAll(start, end);
97      }
98  
99      public int getExpandoColumnsCount() throws SystemException {
100         return expandoColumnPersistence.countAll();
101     }
102 
103     public ExpandoColumn updateExpandoColumn(ExpandoColumn expandoColumn)
104         throws SystemException {
105         expandoColumn.setNew(false);
106 
107         return expandoColumnPersistence.update(expandoColumn, true);
108     }
109 
110     public ExpandoColumn updateExpandoColumn(ExpandoColumn expandoColumn,
111         boolean merge) throws SystemException {
112         expandoColumn.setNew(false);
113 
114         return expandoColumnPersistence.update(expandoColumn, merge);
115     }
116 
117     public ExpandoColumnLocalService getExpandoColumnLocalService() {
118         return expandoColumnLocalService;
119     }
120 
121     public void setExpandoColumnLocalService(
122         ExpandoColumnLocalService expandoColumnLocalService) {
123         this.expandoColumnLocalService = expandoColumnLocalService;
124     }
125 
126     public ExpandoColumnService getExpandoColumnService() {
127         return expandoColumnService;
128     }
129 
130     public void setExpandoColumnService(
131         ExpandoColumnService expandoColumnService) {
132         this.expandoColumnService = expandoColumnService;
133     }
134 
135     public ExpandoColumnPersistence getExpandoColumnPersistence() {
136         return expandoColumnPersistence;
137     }
138 
139     public void setExpandoColumnPersistence(
140         ExpandoColumnPersistence expandoColumnPersistence) {
141         this.expandoColumnPersistence = expandoColumnPersistence;
142     }
143 
144     public ExpandoRowLocalService getExpandoRowLocalService() {
145         return expandoRowLocalService;
146     }
147 
148     public void setExpandoRowLocalService(
149         ExpandoRowLocalService expandoRowLocalService) {
150         this.expandoRowLocalService = expandoRowLocalService;
151     }
152 
153     public ExpandoRowPersistence getExpandoRowPersistence() {
154         return expandoRowPersistence;
155     }
156 
157     public void setExpandoRowPersistence(
158         ExpandoRowPersistence expandoRowPersistence) {
159         this.expandoRowPersistence = expandoRowPersistence;
160     }
161 
162     public ExpandoTableLocalService getExpandoTableLocalService() {
163         return expandoTableLocalService;
164     }
165 
166     public void setExpandoTableLocalService(
167         ExpandoTableLocalService expandoTableLocalService) {
168         this.expandoTableLocalService = expandoTableLocalService;
169     }
170 
171     public ExpandoTablePersistence getExpandoTablePersistence() {
172         return expandoTablePersistence;
173     }
174 
175     public void setExpandoTablePersistence(
176         ExpandoTablePersistence expandoTablePersistence) {
177         this.expandoTablePersistence = expandoTablePersistence;
178     }
179 
180     public ExpandoValueLocalService getExpandoValueLocalService() {
181         return expandoValueLocalService;
182     }
183 
184     public void setExpandoValueLocalService(
185         ExpandoValueLocalService expandoValueLocalService) {
186         this.expandoValueLocalService = expandoValueLocalService;
187     }
188 
189     public ExpandoValueService getExpandoValueService() {
190         return expandoValueService;
191     }
192 
193     public void setExpandoValueService(ExpandoValueService expandoValueService) {
194         this.expandoValueService = expandoValueService;
195     }
196 
197     public ExpandoValuePersistence getExpandoValuePersistence() {
198         return expandoValuePersistence;
199     }
200 
201     public void setExpandoValuePersistence(
202         ExpandoValuePersistence expandoValuePersistence) {
203         this.expandoValuePersistence = expandoValuePersistence;
204     }
205 
206     public CounterLocalService getCounterLocalService() {
207         return counterLocalService;
208     }
209 
210     public void setCounterLocalService(CounterLocalService counterLocalService) {
211         this.counterLocalService = counterLocalService;
212     }
213 
214     public CounterService getCounterService() {
215         return counterService;
216     }
217 
218     public void setCounterService(CounterService counterService) {
219         this.counterService = counterService;
220     }
221 
222     public ResourceLocalService getResourceLocalService() {
223         return resourceLocalService;
224     }
225 
226     public void setResourceLocalService(
227         ResourceLocalService resourceLocalService) {
228         this.resourceLocalService = resourceLocalService;
229     }
230 
231     public ResourceService getResourceService() {
232         return resourceService;
233     }
234 
235     public void setResourceService(ResourceService resourceService) {
236         this.resourceService = resourceService;
237     }
238 
239     public ResourcePersistence getResourcePersistence() {
240         return resourcePersistence;
241     }
242 
243     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
244         this.resourcePersistence = resourcePersistence;
245     }
246 
247     public ResourceFinder getResourceFinder() {
248         return resourceFinder;
249     }
250 
251     public void setResourceFinder(ResourceFinder resourceFinder) {
252         this.resourceFinder = resourceFinder;
253     }
254 
255     protected void runSQL(String sql) throws SystemException {
256         try {
257             PortalUtil.runSQL(sql);
258         }
259         catch (Exception e) {
260             throw new SystemException(e);
261         }
262     }
263 
264     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnLocalService.impl")
265     protected ExpandoColumnLocalService expandoColumnLocalService;
266     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnService.impl")
267     protected ExpandoColumnService expandoColumnService;
268     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence.impl")
269     protected ExpandoColumnPersistence expandoColumnPersistence;
270     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoRowLocalService.impl")
271     protected ExpandoRowLocalService expandoRowLocalService;
272     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence.impl")
273     protected ExpandoRowPersistence expandoRowPersistence;
274     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoTableLocalService.impl")
275     protected ExpandoTableLocalService expandoTableLocalService;
276     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence.impl")
277     protected ExpandoTablePersistence expandoTablePersistence;
278     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueLocalService.impl")
279     protected ExpandoValueLocalService expandoValueLocalService;
280     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueService.impl")
281     protected ExpandoValueService expandoValueService;
282     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence.impl")
283     protected ExpandoValuePersistence expandoValuePersistence;
284     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
285     protected CounterLocalService counterLocalService;
286     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
287     protected CounterService counterService;
288     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService.impl")
289     protected ResourceLocalService resourceLocalService;
290     @BeanReference(name = "com.liferay.portal.service.ResourceService.impl")
291     protected ResourceService resourceService;
292     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
293     protected ResourcePersistence resourcePersistence;
294     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder.impl")
295     protected ResourceFinder resourceFinder;
296 }