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