1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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.util.PortalUtil;
33  
34  import com.liferay.portlet.expando.model.ExpandoTable;
35  import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
36  import com.liferay.portlet.expando.service.ExpandoRowLocalService;
37  import com.liferay.portlet.expando.service.ExpandoTableLocalService;
38  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
39  import com.liferay.portlet.expando.service.persistence.ExpandoColumnFinder;
40  import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
41  import com.liferay.portlet.expando.service.persistence.ExpandoRowFinder;
42  import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
43  import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
44  import com.liferay.portlet.expando.service.persistence.ExpandoValueFinder;
45  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
46  
47  import java.util.List;
48  
49  /**
50   * <a href="ExpandoTableLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
51   *
52   * @author Brian Wing Shun Chan
53   *
54   */
55  public abstract class ExpandoTableLocalServiceBaseImpl
56      implements ExpandoTableLocalService {
57      public ExpandoTable addExpandoTable(ExpandoTable expandoTable)
58          throws SystemException {
59          expandoTable.setNew(true);
60  
61          return expandoTablePersistence.update(expandoTable, false);
62      }
63  
64      public ExpandoTable createExpandoTable(long tableId) {
65          return expandoTablePersistence.create(tableId);
66      }
67  
68      public void deleteExpandoTable(long tableId)
69          throws PortalException, SystemException {
70          expandoTablePersistence.remove(tableId);
71      }
72  
73      public void deleteExpandoTable(ExpandoTable expandoTable)
74          throws SystemException {
75          expandoTablePersistence.remove(expandoTable);
76      }
77  
78      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
79          throws SystemException {
80          return expandoTablePersistence.findWithDynamicQuery(dynamicQuery);
81      }
82  
83      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
84          int end) throws SystemException {
85          return expandoTablePersistence.findWithDynamicQuery(dynamicQuery,
86              start, end);
87      }
88  
89      public ExpandoTable getExpandoTable(long tableId)
90          throws PortalException, SystemException {
91          return expandoTablePersistence.findByPrimaryKey(tableId);
92      }
93  
94      public List<ExpandoTable> getExpandoTables(int start, int end)
95          throws SystemException {
96          return expandoTablePersistence.findAll(start, end);
97      }
98  
99      public int getExpandoTablesCount() throws SystemException {
100         return expandoTablePersistence.countAll();
101     }
102 
103     public ExpandoTable updateExpandoTable(ExpandoTable expandoTable)
104         throws SystemException {
105         expandoTable.setNew(false);
106 
107         return expandoTablePersistence.update(expandoTable, true);
108     }
109 
110     public ExpandoTable updateExpandoTable(ExpandoTable expandoTable,
111         boolean merge) throws SystemException {
112         expandoTable.setNew(false);
113 
114         return expandoTablePersistence.update(expandoTable, 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 ExpandoColumnPersistence getExpandoColumnPersistence() {
127         return expandoColumnPersistence;
128     }
129 
130     public void setExpandoColumnPersistence(
131         ExpandoColumnPersistence expandoColumnPersistence) {
132         this.expandoColumnPersistence = expandoColumnPersistence;
133     }
134 
135     public ExpandoColumnFinder getExpandoColumnFinder() {
136         return expandoColumnFinder;
137     }
138 
139     public void setExpandoColumnFinder(ExpandoColumnFinder expandoColumnFinder) {
140         this.expandoColumnFinder = expandoColumnFinder;
141     }
142 
143     public ExpandoRowLocalService getExpandoRowLocalService() {
144         return expandoRowLocalService;
145     }
146 
147     public void setExpandoRowLocalService(
148         ExpandoRowLocalService expandoRowLocalService) {
149         this.expandoRowLocalService = expandoRowLocalService;
150     }
151 
152     public ExpandoRowPersistence getExpandoRowPersistence() {
153         return expandoRowPersistence;
154     }
155 
156     public void setExpandoRowPersistence(
157         ExpandoRowPersistence expandoRowPersistence) {
158         this.expandoRowPersistence = expandoRowPersistence;
159     }
160 
161     public ExpandoRowFinder getExpandoRowFinder() {
162         return expandoRowFinder;
163     }
164 
165     public void setExpandoRowFinder(ExpandoRowFinder expandoRowFinder) {
166         this.expandoRowFinder = expandoRowFinder;
167     }
168 
169     public ExpandoTableLocalService getExpandoTableLocalService() {
170         return expandoTableLocalService;
171     }
172 
173     public void setExpandoTableLocalService(
174         ExpandoTableLocalService expandoTableLocalService) {
175         this.expandoTableLocalService = expandoTableLocalService;
176     }
177 
178     public ExpandoTablePersistence getExpandoTablePersistence() {
179         return expandoTablePersistence;
180     }
181 
182     public void setExpandoTablePersistence(
183         ExpandoTablePersistence expandoTablePersistence) {
184         this.expandoTablePersistence = expandoTablePersistence;
185     }
186 
187     public ExpandoValueLocalService getExpandoValueLocalService() {
188         return expandoValueLocalService;
189     }
190 
191     public void setExpandoValueLocalService(
192         ExpandoValueLocalService expandoValueLocalService) {
193         this.expandoValueLocalService = expandoValueLocalService;
194     }
195 
196     public ExpandoValuePersistence getExpandoValuePersistence() {
197         return expandoValuePersistence;
198     }
199 
200     public void setExpandoValuePersistence(
201         ExpandoValuePersistence expandoValuePersistence) {
202         this.expandoValuePersistence = expandoValuePersistence;
203     }
204 
205     public ExpandoValueFinder getExpandoValueFinder() {
206         return expandoValueFinder;
207     }
208 
209     public void setExpandoValueFinder(ExpandoValueFinder expandoValueFinder) {
210         this.expandoValueFinder = expandoValueFinder;
211     }
212 
213     public CounterLocalService getCounterLocalService() {
214         return counterLocalService;
215     }
216 
217     public void setCounterLocalService(CounterLocalService counterLocalService) {
218         this.counterLocalService = counterLocalService;
219     }
220 
221     public CounterService getCounterService() {
222         return counterService;
223     }
224 
225     public void setCounterService(CounterService counterService) {
226         this.counterService = counterService;
227     }
228 
229     protected void runSQL(String sql) throws SystemException {
230         try {
231             PortalUtil.runSQL(sql);
232         }
233         catch (Exception e) {
234             throw new SystemException(e);
235         }
236     }
237 
238     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnLocalService.impl")
239     protected ExpandoColumnLocalService expandoColumnLocalService;
240     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence.impl")
241     protected ExpandoColumnPersistence expandoColumnPersistence;
242     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnFinder.impl")
243     protected ExpandoColumnFinder expandoColumnFinder;
244     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoRowLocalService.impl")
245     protected ExpandoRowLocalService expandoRowLocalService;
246     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence.impl")
247     protected ExpandoRowPersistence expandoRowPersistence;
248     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowFinder.impl")
249     protected ExpandoRowFinder expandoRowFinder;
250     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoTableLocalService.impl")
251     protected ExpandoTableLocalService expandoTableLocalService;
252     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence.impl")
253     protected ExpandoTablePersistence expandoTablePersistence;
254     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueLocalService.impl")
255     protected ExpandoValueLocalService expandoValueLocalService;
256     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence.impl")
257     protected ExpandoValuePersistence expandoValuePersistence;
258     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValueFinder.impl")
259     protected ExpandoValueFinder expandoValueFinder;
260     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
261     protected CounterLocalService counterLocalService;
262     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
263     protected CounterService counterService;
264 }