1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.expando.service.base;
21  
22  import com.liferay.counter.service.CounterLocalService;
23  import com.liferay.counter.service.CounterService;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.BeanReference;
28  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
29  import com.liferay.portal.util.PortalUtil;
30  
31  import com.liferay.portlet.expando.model.ExpandoRow;
32  import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
33  import com.liferay.portlet.expando.service.ExpandoRowLocalService;
34  import com.liferay.portlet.expando.service.ExpandoTableLocalService;
35  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
36  import com.liferay.portlet.expando.service.persistence.ExpandoColumnFinder;
37  import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
38  import com.liferay.portlet.expando.service.persistence.ExpandoRowFinder;
39  import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
40  import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
41  import com.liferay.portlet.expando.service.persistence.ExpandoValueFinder;
42  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
43  
44  import java.util.List;
45  
46  /**
47   * <a href="ExpandoRowLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
48   *
49   * @author Brian Wing Shun Chan
50   *
51   */
52  public abstract class ExpandoRowLocalServiceBaseImpl
53      implements ExpandoRowLocalService {
54      public ExpandoRow addExpandoRow(ExpandoRow expandoRow)
55          throws SystemException {
56          expandoRow.setNew(true);
57  
58          return expandoRowPersistence.update(expandoRow, false);
59      }
60  
61      public ExpandoRow createExpandoRow(long rowId) {
62          return expandoRowPersistence.create(rowId);
63      }
64  
65      public void deleteExpandoRow(long rowId)
66          throws PortalException, SystemException {
67          expandoRowPersistence.remove(rowId);
68      }
69  
70      public void deleteExpandoRow(ExpandoRow expandoRow)
71          throws SystemException {
72          expandoRowPersistence.remove(expandoRow);
73      }
74  
75      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
76          throws SystemException {
77          return expandoRowPersistence.findWithDynamicQuery(dynamicQuery);
78      }
79  
80      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
81          int end) throws SystemException {
82          return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
83              end);
84      }
85  
86      public ExpandoRow getExpandoRow(long rowId)
87          throws PortalException, SystemException {
88          return expandoRowPersistence.findByPrimaryKey(rowId);
89      }
90  
91      public List<ExpandoRow> getExpandoRows(int start, int end)
92          throws SystemException {
93          return expandoRowPersistence.findAll(start, end);
94      }
95  
96      public int getExpandoRowsCount() throws SystemException {
97          return expandoRowPersistence.countAll();
98      }
99  
100     public ExpandoRow updateExpandoRow(ExpandoRow expandoRow)
101         throws SystemException {
102         expandoRow.setNew(false);
103 
104         return expandoRowPersistence.update(expandoRow, true);
105     }
106 
107     public ExpandoRow updateExpandoRow(ExpandoRow expandoRow, boolean merge)
108         throws SystemException {
109         expandoRow.setNew(false);
110 
111         return expandoRowPersistence.update(expandoRow, merge);
112     }
113 
114     public ExpandoColumnLocalService getExpandoColumnLocalService() {
115         return expandoColumnLocalService;
116     }
117 
118     public void setExpandoColumnLocalService(
119         ExpandoColumnLocalService expandoColumnLocalService) {
120         this.expandoColumnLocalService = expandoColumnLocalService;
121     }
122 
123     public ExpandoColumnPersistence getExpandoColumnPersistence() {
124         return expandoColumnPersistence;
125     }
126 
127     public void setExpandoColumnPersistence(
128         ExpandoColumnPersistence expandoColumnPersistence) {
129         this.expandoColumnPersistence = expandoColumnPersistence;
130     }
131 
132     public ExpandoColumnFinder getExpandoColumnFinder() {
133         return expandoColumnFinder;
134     }
135 
136     public void setExpandoColumnFinder(ExpandoColumnFinder expandoColumnFinder) {
137         this.expandoColumnFinder = expandoColumnFinder;
138     }
139 
140     public ExpandoRowLocalService getExpandoRowLocalService() {
141         return expandoRowLocalService;
142     }
143 
144     public void setExpandoRowLocalService(
145         ExpandoRowLocalService expandoRowLocalService) {
146         this.expandoRowLocalService = expandoRowLocalService;
147     }
148 
149     public ExpandoRowPersistence getExpandoRowPersistence() {
150         return expandoRowPersistence;
151     }
152 
153     public void setExpandoRowPersistence(
154         ExpandoRowPersistence expandoRowPersistence) {
155         this.expandoRowPersistence = expandoRowPersistence;
156     }
157 
158     public ExpandoRowFinder getExpandoRowFinder() {
159         return expandoRowFinder;
160     }
161 
162     public void setExpandoRowFinder(ExpandoRowFinder expandoRowFinder) {
163         this.expandoRowFinder = expandoRowFinder;
164     }
165 
166     public ExpandoTableLocalService getExpandoTableLocalService() {
167         return expandoTableLocalService;
168     }
169 
170     public void setExpandoTableLocalService(
171         ExpandoTableLocalService expandoTableLocalService) {
172         this.expandoTableLocalService = expandoTableLocalService;
173     }
174 
175     public ExpandoTablePersistence getExpandoTablePersistence() {
176         return expandoTablePersistence;
177     }
178 
179     public void setExpandoTablePersistence(
180         ExpandoTablePersistence expandoTablePersistence) {
181         this.expandoTablePersistence = expandoTablePersistence;
182     }
183 
184     public ExpandoValueLocalService getExpandoValueLocalService() {
185         return expandoValueLocalService;
186     }
187 
188     public void setExpandoValueLocalService(
189         ExpandoValueLocalService expandoValueLocalService) {
190         this.expandoValueLocalService = expandoValueLocalService;
191     }
192 
193     public ExpandoValuePersistence getExpandoValuePersistence() {
194         return expandoValuePersistence;
195     }
196 
197     public void setExpandoValuePersistence(
198         ExpandoValuePersistence expandoValuePersistence) {
199         this.expandoValuePersistence = expandoValuePersistence;
200     }
201 
202     public ExpandoValueFinder getExpandoValueFinder() {
203         return expandoValueFinder;
204     }
205 
206     public void setExpandoValueFinder(ExpandoValueFinder expandoValueFinder) {
207         this.expandoValueFinder = expandoValueFinder;
208     }
209 
210     public CounterLocalService getCounterLocalService() {
211         return counterLocalService;
212     }
213 
214     public void setCounterLocalService(CounterLocalService counterLocalService) {
215         this.counterLocalService = counterLocalService;
216     }
217 
218     public CounterService getCounterService() {
219         return counterService;
220     }
221 
222     public void setCounterService(CounterService counterService) {
223         this.counterService = counterService;
224     }
225 
226     protected void runSQL(String sql) throws SystemException {
227         try {
228             PortalUtil.runSQL(sql);
229         }
230         catch (Exception e) {
231             throw new SystemException(e);
232         }
233     }
234 
235     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoColumnLocalService.impl")
236     protected ExpandoColumnLocalService expandoColumnLocalService;
237     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence.impl")
238     protected ExpandoColumnPersistence expandoColumnPersistence;
239     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoColumnFinder.impl")
240     protected ExpandoColumnFinder expandoColumnFinder;
241     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoRowLocalService.impl")
242     protected ExpandoRowLocalService expandoRowLocalService;
243     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence.impl")
244     protected ExpandoRowPersistence expandoRowPersistence;
245     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoRowFinder.impl")
246     protected ExpandoRowFinder expandoRowFinder;
247     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoTableLocalService.impl")
248     protected ExpandoTableLocalService expandoTableLocalService;
249     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence.impl")
250     protected ExpandoTablePersistence expandoTablePersistence;
251     @BeanReference(name = "com.liferay.portlet.expando.service.ExpandoValueLocalService.impl")
252     protected ExpandoValueLocalService expandoValueLocalService;
253     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence.impl")
254     protected ExpandoValuePersistence expandoValuePersistence;
255     @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValueFinder.impl")
256     protected ExpandoValueFinder expandoValueFinder;
257     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
258     protected CounterLocalService counterLocalService;
259     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
260     protected CounterService counterService;
261 }