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