1   /**
2    * Copyright (c) 2000-2010 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   *
12   * 
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.PortalException;
21  import com.liferay.portal.SystemException;
22  import com.liferay.portal.kernel.annotation.BeanReference;
23  import com.liferay.portal.kernel.dao.db.DB;
24  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
25  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
26  import com.liferay.portal.kernel.util.OrderByComparator;
27  import com.liferay.portal.service.ResourceLocalService;
28  import com.liferay.portal.service.ResourceService;
29  import com.liferay.portal.service.UserLocalService;
30  import com.liferay.portal.service.UserService;
31  import com.liferay.portal.service.persistence.ResourceFinder;
32  import com.liferay.portal.service.persistence.ResourcePersistence;
33  import com.liferay.portal.service.persistence.UserFinder;
34  import com.liferay.portal.service.persistence.UserPersistence;
35  
36  import com.liferay.portlet.expando.model.ExpandoColumn;
37  import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
38  import com.liferay.portlet.expando.service.ExpandoColumnService;
39  import com.liferay.portlet.expando.service.ExpandoRowLocalService;
40  import com.liferay.portlet.expando.service.ExpandoTableLocalService;
41  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
42  import com.liferay.portlet.expando.service.ExpandoValueService;
43  import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
44  import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
45  import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
46  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
47  
48  import java.util.List;
49  
50  /**
51   * <a href="ExpandoColumnLocalServiceBaseImpl.java.html"><b><i>View Source</i>
52   * </b></a>
53   *
54   * @author Brian Wing Shun Chan
55   */
56  public abstract class ExpandoColumnLocalServiceBaseImpl
57      implements ExpandoColumnLocalService {
58      public ExpandoColumn addExpandoColumn(ExpandoColumn expandoColumn)
59          throws SystemException {
60          expandoColumn.setNew(true);
61  
62          return expandoColumnPersistence.update(expandoColumn, false);
63      }
64  
65      public ExpandoColumn createExpandoColumn(long columnId) {
66          return expandoColumnPersistence.create(columnId);
67      }
68  
69      public void deleteExpandoColumn(long columnId)
70          throws PortalException, SystemException {
71          expandoColumnPersistence.remove(columnId);
72      }
73  
74      public void deleteExpandoColumn(ExpandoColumn expandoColumn)
75          throws SystemException {
76          expandoColumnPersistence.remove(expandoColumn);
77      }
78  
79      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
80          throws SystemException {
81          return expandoColumnPersistence.findWithDynamicQuery(dynamicQuery);
82      }
83  
84      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
85          int end) throws SystemException {
86          return expandoColumnPersistence.findWithDynamicQuery(dynamicQuery,
87              start, end);
88      }
89  
90      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
91          int end, OrderByComparator orderByComparator) throws SystemException {
92          return expandoColumnPersistence.findWithDynamicQuery(dynamicQuery,
93              start, end, orderByComparator);
94      }
95  
96      public int dynamicQueryCount(DynamicQuery dynamicQuery)
97          throws SystemException {
98          return expandoColumnPersistence.countWithDynamicQuery(dynamicQuery);
99      }
100 
101     public ExpandoColumn getExpandoColumn(long columnId)
102         throws PortalException, SystemException {
103         return expandoColumnPersistence.findByPrimaryKey(columnId);
104     }
105 
106     public List<ExpandoColumn> getExpandoColumns(int start, int end)
107         throws SystemException {
108         return expandoColumnPersistence.findAll(start, end);
109     }
110 
111     public int getExpandoColumnsCount() throws SystemException {
112         return expandoColumnPersistence.countAll();
113     }
114 
115     public ExpandoColumn updateExpandoColumn(ExpandoColumn expandoColumn)
116         throws SystemException {
117         expandoColumn.setNew(false);
118 
119         return expandoColumnPersistence.update(expandoColumn, true);
120     }
121 
122     public ExpandoColumn updateExpandoColumn(ExpandoColumn expandoColumn,
123         boolean merge) throws SystemException {
124         expandoColumn.setNew(false);
125 
126         return expandoColumnPersistence.update(expandoColumn, merge);
127     }
128 
129     public ExpandoColumnLocalService getExpandoColumnLocalService() {
130         return expandoColumnLocalService;
131     }
132 
133     public void setExpandoColumnLocalService(
134         ExpandoColumnLocalService expandoColumnLocalService) {
135         this.expandoColumnLocalService = expandoColumnLocalService;
136     }
137 
138     public ExpandoColumnService getExpandoColumnService() {
139         return expandoColumnService;
140     }
141 
142     public void setExpandoColumnService(
143         ExpandoColumnService expandoColumnService) {
144         this.expandoColumnService = expandoColumnService;
145     }
146 
147     public ExpandoColumnPersistence getExpandoColumnPersistence() {
148         return expandoColumnPersistence;
149     }
150 
151     public void setExpandoColumnPersistence(
152         ExpandoColumnPersistence expandoColumnPersistence) {
153         this.expandoColumnPersistence = expandoColumnPersistence;
154     }
155 
156     public ExpandoRowLocalService getExpandoRowLocalService() {
157         return expandoRowLocalService;
158     }
159 
160     public void setExpandoRowLocalService(
161         ExpandoRowLocalService expandoRowLocalService) {
162         this.expandoRowLocalService = expandoRowLocalService;
163     }
164 
165     public ExpandoRowPersistence getExpandoRowPersistence() {
166         return expandoRowPersistence;
167     }
168 
169     public void setExpandoRowPersistence(
170         ExpandoRowPersistence expandoRowPersistence) {
171         this.expandoRowPersistence = expandoRowPersistence;
172     }
173 
174     public ExpandoTableLocalService getExpandoTableLocalService() {
175         return expandoTableLocalService;
176     }
177 
178     public void setExpandoTableLocalService(
179         ExpandoTableLocalService expandoTableLocalService) {
180         this.expandoTableLocalService = expandoTableLocalService;
181     }
182 
183     public ExpandoTablePersistence getExpandoTablePersistence() {
184         return expandoTablePersistence;
185     }
186 
187     public void setExpandoTablePersistence(
188         ExpandoTablePersistence expandoTablePersistence) {
189         this.expandoTablePersistence = expandoTablePersistence;
190     }
191 
192     public ExpandoValueLocalService getExpandoValueLocalService() {
193         return expandoValueLocalService;
194     }
195 
196     public void setExpandoValueLocalService(
197         ExpandoValueLocalService expandoValueLocalService) {
198         this.expandoValueLocalService = expandoValueLocalService;
199     }
200 
201     public ExpandoValueService getExpandoValueService() {
202         return expandoValueService;
203     }
204 
205     public void setExpandoValueService(ExpandoValueService expandoValueService) {
206         this.expandoValueService = expandoValueService;
207     }
208 
209     public ExpandoValuePersistence getExpandoValuePersistence() {
210         return expandoValuePersistence;
211     }
212 
213     public void setExpandoValuePersistence(
214         ExpandoValuePersistence expandoValuePersistence) {
215         this.expandoValuePersistence = expandoValuePersistence;
216     }
217 
218     public CounterLocalService getCounterLocalService() {
219         return counterLocalService;
220     }
221 
222     public void setCounterLocalService(CounterLocalService counterLocalService) {
223         this.counterLocalService = counterLocalService;
224     }
225 
226     public CounterService getCounterService() {
227         return counterService;
228     }
229 
230     public void setCounterService(CounterService counterService) {
231         this.counterService = counterService;
232     }
233 
234     public ResourceLocalService getResourceLocalService() {
235         return resourceLocalService;
236     }
237 
238     public void setResourceLocalService(
239         ResourceLocalService resourceLocalService) {
240         this.resourceLocalService = resourceLocalService;
241     }
242 
243     public ResourceService getResourceService() {
244         return resourceService;
245     }
246 
247     public void setResourceService(ResourceService resourceService) {
248         this.resourceService = resourceService;
249     }
250 
251     public ResourcePersistence getResourcePersistence() {
252         return resourcePersistence;
253     }
254 
255     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
256         this.resourcePersistence = resourcePersistence;
257     }
258 
259     public ResourceFinder getResourceFinder() {
260         return resourceFinder;
261     }
262 
263     public void setResourceFinder(ResourceFinder resourceFinder) {
264         this.resourceFinder = resourceFinder;
265     }
266 
267     public UserLocalService getUserLocalService() {
268         return userLocalService;
269     }
270 
271     public void setUserLocalService(UserLocalService userLocalService) {
272         this.userLocalService = userLocalService;
273     }
274 
275     public UserService getUserService() {
276         return userService;
277     }
278 
279     public void setUserService(UserService userService) {
280         this.userService = userService;
281     }
282 
283     public UserPersistence getUserPersistence() {
284         return userPersistence;
285     }
286 
287     public void setUserPersistence(UserPersistence userPersistence) {
288         this.userPersistence = userPersistence;
289     }
290 
291     public UserFinder getUserFinder() {
292         return userFinder;
293     }
294 
295     public void setUserFinder(UserFinder userFinder) {
296         this.userFinder = userFinder;
297     }
298 
299     protected void runSQL(String sql) throws SystemException {
300         try {
301             DB db = DBFactoryUtil.getDB();
302 
303             db.runSQL(sql);
304         }
305         catch (Exception e) {
306             throw new SystemException(e);
307         }
308     }
309 
310     @BeanReference(type = ExpandoColumnLocalService.class)
311     protected ExpandoColumnLocalService expandoColumnLocalService;
312     @BeanReference(type = ExpandoColumnService.class)
313     protected ExpandoColumnService expandoColumnService;
314     @BeanReference(type = ExpandoColumnPersistence.class)
315     protected ExpandoColumnPersistence expandoColumnPersistence;
316     @BeanReference(type = ExpandoRowLocalService.class)
317     protected ExpandoRowLocalService expandoRowLocalService;
318     @BeanReference(type = ExpandoRowPersistence.class)
319     protected ExpandoRowPersistence expandoRowPersistence;
320     @BeanReference(type = ExpandoTableLocalService.class)
321     protected ExpandoTableLocalService expandoTableLocalService;
322     @BeanReference(type = ExpandoTablePersistence.class)
323     protected ExpandoTablePersistence expandoTablePersistence;
324     @BeanReference(type = ExpandoValueLocalService.class)
325     protected ExpandoValueLocalService expandoValueLocalService;
326     @BeanReference(type = ExpandoValueService.class)
327     protected ExpandoValueService expandoValueService;
328     @BeanReference(type = ExpandoValuePersistence.class)
329     protected ExpandoValuePersistence expandoValuePersistence;
330     @BeanReference(type = CounterLocalService.class)
331     protected CounterLocalService counterLocalService;
332     @BeanReference(type = CounterService.class)
333     protected CounterService counterService;
334     @BeanReference(type = ResourceLocalService.class)
335     protected ResourceLocalService resourceLocalService;
336     @BeanReference(type = ResourceService.class)
337     protected ResourceService resourceService;
338     @BeanReference(type = ResourcePersistence.class)
339     protected ResourcePersistence resourcePersistence;
340     @BeanReference(type = ResourceFinder.class)
341     protected ResourceFinder resourceFinder;
342     @BeanReference(type = UserLocalService.class)
343     protected UserLocalService userLocalService;
344     @BeanReference(type = UserService.class)
345     protected UserService userService;
346     @BeanReference(type = UserPersistence.class)
347     protected UserPersistence userPersistence;
348     @BeanReference(type = UserFinder.class)
349     protected UserFinder userFinder;
350 }