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.ExpandoValue;
35  import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
36  import com.liferay.portlet.expando.service.ExpandoColumnService;
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.ExpandoValueService;
41  import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
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.ExpandoValuePersistence;
45  
46  import java.util.List;
47  
48  /**
49   * <a href="ExpandoValueLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
50   *
51   * @author Brian Wing Shun Chan
52   *
53   */
54  public abstract class ExpandoValueLocalServiceBaseImpl
55      implements ExpandoValueLocalService {
56      public ExpandoValue addExpandoValue(ExpandoValue expandoValue)
57          throws SystemException {
58          expandoValue.setNew(true);
59  
60          return expandoValuePersistence.update(expandoValue, false);
61      }
62  
63      public ExpandoValue createExpandoValue(long valueId) {
64          return expandoValuePersistence.create(valueId);
65      }
66  
67      public void deleteExpandoValue(long valueId)
68          throws PortalException, SystemException {
69          expandoValuePersistence.remove(valueId);
70      }
71  
72      public void deleteExpandoValue(ExpandoValue expandoValue)
73          throws SystemException {
74          expandoValuePersistence.remove(expandoValue);
75      }
76  
77      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
78          throws SystemException {
79          return expandoValuePersistence.findWithDynamicQuery(dynamicQuery);
80      }
81  
82      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
83          int end) throws SystemException {
84          return expandoValuePersistence.findWithDynamicQuery(dynamicQuery,
85              start, end);
86      }
87  
88      public ExpandoValue getExpandoValue(long valueId)
89          throws PortalException, SystemException {
90          return expandoValuePersistence.findByPrimaryKey(valueId);
91      }
92  
93      public List<ExpandoValue> getExpandoValues(int start, int end)
94          throws SystemException {
95          return expandoValuePersistence.findAll(start, end);
96      }
97  
98      public int getExpandoValuesCount() throws SystemException {
99          return expandoValuePersistence.countAll();
100     }
101 
102     public ExpandoValue updateExpandoValue(ExpandoValue expandoValue)
103         throws SystemException {
104         expandoValue.setNew(false);
105 
106         return expandoValuePersistence.update(expandoValue, true);
107     }
108 
109     public ExpandoValue updateExpandoValue(ExpandoValue expandoValue,
110         boolean merge) throws SystemException {
111         expandoValue.setNew(false);
112 
113         return expandoValuePersistence.update(expandoValue, merge);
114     }
115 
116     public ExpandoColumnLocalService getExpandoColumnLocalService() {
117         return expandoColumnLocalService;
118     }
119 
120     public void setExpandoColumnLocalService(
121         ExpandoColumnLocalService expandoColumnLocalService) {
122         this.expandoColumnLocalService = expandoColumnLocalService;
123     }
124 
125     public ExpandoColumnService getExpandoColumnService() {
126         return expandoColumnService;
127     }
128 
129     public void setExpandoColumnService(
130         ExpandoColumnService expandoColumnService) {
131         this.expandoColumnService = expandoColumnService;
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 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 ExpandoTableLocalService getExpandoTableLocalService() {
162         return expandoTableLocalService;
163     }
164 
165     public void setExpandoTableLocalService(
166         ExpandoTableLocalService expandoTableLocalService) {
167         this.expandoTableLocalService = expandoTableLocalService;
168     }
169 
170     public ExpandoTablePersistence getExpandoTablePersistence() {
171         return expandoTablePersistence;
172     }
173 
174     public void setExpandoTablePersistence(
175         ExpandoTablePersistence expandoTablePersistence) {
176         this.expandoTablePersistence = expandoTablePersistence;
177     }
178 
179     public ExpandoValueLocalService getExpandoValueLocalService() {
180         return expandoValueLocalService;
181     }
182 
183     public void setExpandoValueLocalService(
184         ExpandoValueLocalService expandoValueLocalService) {
185         this.expandoValueLocalService = expandoValueLocalService;
186     }
187 
188     public ExpandoValueService getExpandoValueService() {
189         return expandoValueService;
190     }
191 
192     public void setExpandoValueService(ExpandoValueService expandoValueService) {
193         this.expandoValueService = expandoValueService;
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 CounterLocalService getCounterLocalService() {
206         return counterLocalService;
207     }
208 
209     public void setCounterLocalService(CounterLocalService counterLocalService) {
210         this.counterLocalService = counterLocalService;
211     }
212 
213     public CounterService getCounterService() {
214         return counterService;
215     }
216 
217     public void setCounterService(CounterService counterService) {
218         this.counterService = counterService;
219     }
220 
221     protected void runSQL(String sql) throws SystemException {
222         try {
223             PortalUtil.runSQL(sql);
224         }
225         catch (Exception e) {
226             throw new SystemException(e);
227         }
228     }
229 
230     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnLocalService.impl")
231     protected ExpandoColumnLocalService expandoColumnLocalService;
232     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnService.impl")
233     protected ExpandoColumnService expandoColumnService;
234     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence.impl")
235     protected ExpandoColumnPersistence expandoColumnPersistence;
236     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoRowLocalService.impl")
237     protected ExpandoRowLocalService expandoRowLocalService;
238     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence.impl")
239     protected ExpandoRowPersistence expandoRowPersistence;
240     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoTableLocalService.impl")
241     protected ExpandoTableLocalService expandoTableLocalService;
242     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence.impl")
243     protected ExpandoTablePersistence expandoTablePersistence;
244     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueLocalService.impl")
245     protected ExpandoValueLocalService expandoValueLocalService;
246     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueService.impl")
247     protected ExpandoValueService expandoValueService;
248     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence.impl")
249     protected ExpandoValuePersistence expandoValuePersistence;
250     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
251     protected CounterLocalService counterLocalService;
252     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
253     protected CounterService counterService;
254 }