1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.expando.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  import com.liferay.counter.service.CounterService;
19  
20  import com.liferay.portal.kernel.annotation.BeanReference;
21  import com.liferay.portal.kernel.dao.db.DB;
22  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
23  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
24  import com.liferay.portal.kernel.exception.PortalException;
25  import com.liferay.portal.kernel.exception.SystemException;
26  import com.liferay.portal.service.ResourceLocalService;
27  import com.liferay.portal.service.ResourceService;
28  import com.liferay.portal.service.UserLocalService;
29  import com.liferay.portal.service.UserService;
30  import com.liferay.portal.service.persistence.ResourceFinder;
31  import com.liferay.portal.service.persistence.ResourcePersistence;
32  import com.liferay.portal.service.persistence.UserFinder;
33  import com.liferay.portal.service.persistence.UserPersistence;
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>
51   * </b></a>
52   *
53   * @author Brian Wing Shun Chan
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     public UserLocalService getUserLocalService() {
256         return userLocalService;
257     }
258 
259     public void setUserLocalService(UserLocalService userLocalService) {
260         this.userLocalService = userLocalService;
261     }
262 
263     public UserService getUserService() {
264         return userService;
265     }
266 
267     public void setUserService(UserService userService) {
268         this.userService = userService;
269     }
270 
271     public UserPersistence getUserPersistence() {
272         return userPersistence;
273     }
274 
275     public void setUserPersistence(UserPersistence userPersistence) {
276         this.userPersistence = userPersistence;
277     }
278 
279     public UserFinder getUserFinder() {
280         return userFinder;
281     }
282 
283     public void setUserFinder(UserFinder userFinder) {
284         this.userFinder = userFinder;
285     }
286 
287     protected void runSQL(String sql) throws SystemException {
288         try {
289             DB db = DBFactoryUtil.getDB();
290 
291             db.runSQL(sql);
292         }
293         catch (Exception e) {
294             throw new SystemException(e);
295         }
296     }
297 
298     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnLocalService")
299     protected ExpandoColumnLocalService expandoColumnLocalService;
300     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnService")
301     protected ExpandoColumnService expandoColumnService;
302     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence")
303     protected ExpandoColumnPersistence expandoColumnPersistence;
304     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoRowLocalService")
305     protected ExpandoRowLocalService expandoRowLocalService;
306     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence")
307     protected ExpandoRowPersistence expandoRowPersistence;
308     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoTableLocalService")
309     protected ExpandoTableLocalService expandoTableLocalService;
310     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence")
311     protected ExpandoTablePersistence expandoTablePersistence;
312     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueLocalService")
313     protected ExpandoValueLocalService expandoValueLocalService;
314     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueService")
315     protected ExpandoValueService expandoValueService;
316     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence")
317     protected ExpandoValuePersistence expandoValuePersistence;
318     @BeanReference(name = "com.liferay.counter.service.CounterLocalService")
319     protected CounterLocalService counterLocalService;
320     @BeanReference(name = "com.liferay.counter.service.CounterService")
321     protected CounterService counterService;
322     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService")
323     protected ResourceLocalService resourceLocalService;
324     @BeanReference(name = "com.liferay.portal.service.ResourceService")
325     protected ResourceService resourceService;
326     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
327     protected ResourcePersistence resourcePersistence;
328     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder")
329     protected ResourceFinder resourceFinder;
330     @BeanReference(name = "com.liferay.portal.service.UserLocalService")
331     protected UserLocalService userLocalService;
332     @BeanReference(name = "com.liferay.portal.service.UserService")
333     protected UserService userService;
334     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
335     protected UserPersistence userPersistence;
336     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder")
337     protected UserFinder userFinder;
338 }