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