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.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.ExpandoTable;
36  import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
37  import com.liferay.portlet.expando.service.ExpandoRowLocalService;
38  import com.liferay.portlet.expando.service.ExpandoTableLocalService;
39  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
40  import com.liferay.portlet.expando.service.persistence.ExpandoColumnFinder;
41  import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
42  import com.liferay.portlet.expando.service.persistence.ExpandoRowFinder;
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.ExpandoValueFinder;
46  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
47  
48  import java.util.List;
49  
50  /**
51   * <a href="ExpandoTableLocalServiceBaseImpl.java.html"><b><i>View Source</i>
52   * </b></a>
53   *
54   * @author Brian Wing Shun Chan
55   */
56  public abstract class ExpandoTableLocalServiceBaseImpl
57      implements ExpandoTableLocalService {
58      public ExpandoTable addExpandoTable(ExpandoTable expandoTable)
59          throws SystemException {
60          expandoTable.setNew(true);
61  
62          return expandoTablePersistence.update(expandoTable, false);
63      }
64  
65      public ExpandoTable createExpandoTable(long tableId) {
66          return expandoTablePersistence.create(tableId);
67      }
68  
69      public void deleteExpandoTable(long tableId)
70          throws PortalException, SystemException {
71          expandoTablePersistence.remove(tableId);
72      }
73  
74      public void deleteExpandoTable(ExpandoTable expandoTable)
75          throws SystemException {
76          expandoTablePersistence.remove(expandoTable);
77      }
78  
79      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
80          throws SystemException {
81          return expandoTablePersistence.findWithDynamicQuery(dynamicQuery);
82      }
83  
84      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
85          int end) throws SystemException {
86          return expandoTablePersistence.findWithDynamicQuery(dynamicQuery,
87              start, end);
88      }
89  
90      public ExpandoTable getExpandoTable(long tableId)
91          throws PortalException, SystemException {
92          return expandoTablePersistence.findByPrimaryKey(tableId);
93      }
94  
95      public List<ExpandoTable> getExpandoTables(int start, int end)
96          throws SystemException {
97          return expandoTablePersistence.findAll(start, end);
98      }
99  
100     public int getExpandoTablesCount() throws SystemException {
101         return expandoTablePersistence.countAll();
102     }
103 
104     public ExpandoTable updateExpandoTable(ExpandoTable expandoTable)
105         throws SystemException {
106         expandoTable.setNew(false);
107 
108         return expandoTablePersistence.update(expandoTable, true);
109     }
110 
111     public ExpandoTable updateExpandoTable(ExpandoTable expandoTable,
112         boolean merge) throws SystemException {
113         expandoTable.setNew(false);
114 
115         return expandoTablePersistence.update(expandoTable, merge);
116     }
117 
118     public ExpandoColumnLocalService getExpandoColumnLocalService() {
119         return expandoColumnLocalService;
120     }
121 
122     public void setExpandoColumnLocalService(
123         ExpandoColumnLocalService expandoColumnLocalService) {
124         this.expandoColumnLocalService = expandoColumnLocalService;
125     }
126 
127     public ExpandoColumnPersistence getExpandoColumnPersistence() {
128         return expandoColumnPersistence;
129     }
130 
131     public void setExpandoColumnPersistence(
132         ExpandoColumnPersistence expandoColumnPersistence) {
133         this.expandoColumnPersistence = expandoColumnPersistence;
134     }
135 
136     public ExpandoColumnFinder getExpandoColumnFinder() {
137         return expandoColumnFinder;
138     }
139 
140     public void setExpandoColumnFinder(ExpandoColumnFinder expandoColumnFinder) {
141         this.expandoColumnFinder = expandoColumnFinder;
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 ExpandoRowFinder getExpandoRowFinder() {
163         return expandoRowFinder;
164     }
165 
166     public void setExpandoRowFinder(ExpandoRowFinder expandoRowFinder) {
167         this.expandoRowFinder = expandoRowFinder;
168     }
169 
170     public ExpandoTableLocalService getExpandoTableLocalService() {
171         return expandoTableLocalService;
172     }
173 
174     public void setExpandoTableLocalService(
175         ExpandoTableLocalService expandoTableLocalService) {
176         this.expandoTableLocalService = expandoTableLocalService;
177     }
178 
179     public ExpandoTablePersistence getExpandoTablePersistence() {
180         return expandoTablePersistence;
181     }
182 
183     public void setExpandoTablePersistence(
184         ExpandoTablePersistence expandoTablePersistence) {
185         this.expandoTablePersistence = expandoTablePersistence;
186     }
187 
188     public ExpandoValueLocalService getExpandoValueLocalService() {
189         return expandoValueLocalService;
190     }
191 
192     public void setExpandoValueLocalService(
193         ExpandoValueLocalService expandoValueLocalService) {
194         this.expandoValueLocalService = expandoValueLocalService;
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 ExpandoValueFinder getExpandoValueFinder() {
207         return expandoValueFinder;
208     }
209 
210     public void setExpandoValueFinder(ExpandoValueFinder expandoValueFinder) {
211         this.expandoValueFinder = expandoValueFinder;
212     }
213 
214     public CounterLocalService getCounterLocalService() {
215         return counterLocalService;
216     }
217 
218     public void setCounterLocalService(CounterLocalService counterLocalService) {
219         this.counterLocalService = counterLocalService;
220     }
221 
222     public CounterService getCounterService() {
223         return counterService;
224     }
225 
226     public void setCounterService(CounterService counterService) {
227         this.counterService = counterService;
228     }
229 
230     public ResourceLocalService getResourceLocalService() {
231         return resourceLocalService;
232     }
233 
234     public void setResourceLocalService(
235         ResourceLocalService resourceLocalService) {
236         this.resourceLocalService = resourceLocalService;
237     }
238 
239     public ResourceService getResourceService() {
240         return resourceService;
241     }
242 
243     public void setResourceService(ResourceService resourceService) {
244         this.resourceService = resourceService;
245     }
246 
247     public ResourcePersistence getResourcePersistence() {
248         return resourcePersistence;
249     }
250 
251     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
252         this.resourcePersistence = resourcePersistence;
253     }
254 
255     public ResourceFinder getResourceFinder() {
256         return resourceFinder;
257     }
258 
259     public void setResourceFinder(ResourceFinder resourceFinder) {
260         this.resourceFinder = resourceFinder;
261     }
262 
263     public UserLocalService getUserLocalService() {
264         return userLocalService;
265     }
266 
267     public void setUserLocalService(UserLocalService userLocalService) {
268         this.userLocalService = userLocalService;
269     }
270 
271     public UserService getUserService() {
272         return userService;
273     }
274 
275     public void setUserService(UserService userService) {
276         this.userService = userService;
277     }
278 
279     public UserPersistence getUserPersistence() {
280         return userPersistence;
281     }
282 
283     public void setUserPersistence(UserPersistence userPersistence) {
284         this.userPersistence = userPersistence;
285     }
286 
287     public UserFinder getUserFinder() {
288         return userFinder;
289     }
290 
291     public void setUserFinder(UserFinder userFinder) {
292         this.userFinder = userFinder;
293     }
294 
295     protected void runSQL(String sql) throws SystemException {
296         try {
297             DB db = DBFactoryUtil.getDB();
298 
299             db.runSQL(sql);
300         }
301         catch (Exception e) {
302             throw new SystemException(e);
303         }
304     }
305 
306     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnLocalService")
307     protected ExpandoColumnLocalService expandoColumnLocalService;
308     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence")
309     protected ExpandoColumnPersistence expandoColumnPersistence;
310     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnFinder")
311     protected ExpandoColumnFinder expandoColumnFinder;
312     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoRowLocalService")
313     protected ExpandoRowLocalService expandoRowLocalService;
314     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence")
315     protected ExpandoRowPersistence expandoRowPersistence;
316     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowFinder")
317     protected ExpandoRowFinder expandoRowFinder;
318     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoTableLocalService")
319     protected ExpandoTableLocalService expandoTableLocalService;
320     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence")
321     protected ExpandoTablePersistence expandoTablePersistence;
322     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueLocalService")
323     protected ExpandoValueLocalService expandoValueLocalService;
324     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence")
325     protected ExpandoValuePersistence expandoValuePersistence;
326     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValueFinder")
327     protected ExpandoValueFinder expandoValueFinder;
328     @BeanReference(name = "com.liferay.counter.service.CounterLocalService")
329     protected CounterLocalService counterLocalService;
330     @BeanReference(name = "com.liferay.counter.service.CounterService")
331     protected CounterService counterService;
332     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService")
333     protected ResourceLocalService resourceLocalService;
334     @BeanReference(name = "com.liferay.portal.service.ResourceService")
335     protected ResourceService resourceService;
336     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
337     protected ResourcePersistence resourcePersistence;
338     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder")
339     protected ResourceFinder resourceFinder;
340     @BeanReference(name = "com.liferay.portal.service.UserLocalService")
341     protected UserLocalService userLocalService;
342     @BeanReference(name = "com.liferay.portal.service.UserService")
343     protected UserService userService;
344     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
345     protected UserPersistence userPersistence;
346     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder")
347     protected UserFinder userFinder;
348 }