1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.expando.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  
19  import com.liferay.portal.kernel.annotation.BeanReference;
20  import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
21  import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
22  import com.liferay.portal.kernel.exception.SystemException;
23  import com.liferay.portal.service.ResourceLocalService;
24  import com.liferay.portal.service.ResourceService;
25  import com.liferay.portal.service.UserLocalService;
26  import com.liferay.portal.service.UserService;
27  import com.liferay.portal.service.base.PrincipalBean;
28  import com.liferay.portal.service.persistence.ResourceFinder;
29  import com.liferay.portal.service.persistence.ResourcePersistence;
30  import com.liferay.portal.service.persistence.UserFinder;
31  import com.liferay.portal.service.persistence.UserPersistence;
32  
33  import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
34  import com.liferay.portlet.expando.service.ExpandoColumnService;
35  import com.liferay.portlet.expando.service.ExpandoRowLocalService;
36  import com.liferay.portlet.expando.service.ExpandoTableLocalService;
37  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
38  import com.liferay.portlet.expando.service.ExpandoValueService;
39  import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
40  import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
41  import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
42  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
43  
44  import javax.sql.DataSource;
45  
46  /**
47   * <a href="ExpandoValueServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
48   *
49   * @author Brian Wing Shun Chan
50   */
51  public abstract class ExpandoValueServiceBaseImpl extends PrincipalBean
52      implements ExpandoValueService {
53      public ExpandoColumnLocalService getExpandoColumnLocalService() {
54          return expandoColumnLocalService;
55      }
56  
57      public void setExpandoColumnLocalService(
58          ExpandoColumnLocalService expandoColumnLocalService) {
59          this.expandoColumnLocalService = expandoColumnLocalService;
60      }
61  
62      public ExpandoColumnService getExpandoColumnService() {
63          return expandoColumnService;
64      }
65  
66      public void setExpandoColumnService(
67          ExpandoColumnService expandoColumnService) {
68          this.expandoColumnService = expandoColumnService;
69      }
70  
71      public ExpandoColumnPersistence getExpandoColumnPersistence() {
72          return expandoColumnPersistence;
73      }
74  
75      public void setExpandoColumnPersistence(
76          ExpandoColumnPersistence expandoColumnPersistence) {
77          this.expandoColumnPersistence = expandoColumnPersistence;
78      }
79  
80      public ExpandoRowLocalService getExpandoRowLocalService() {
81          return expandoRowLocalService;
82      }
83  
84      public void setExpandoRowLocalService(
85          ExpandoRowLocalService expandoRowLocalService) {
86          this.expandoRowLocalService = expandoRowLocalService;
87      }
88  
89      public ExpandoRowPersistence getExpandoRowPersistence() {
90          return expandoRowPersistence;
91      }
92  
93      public void setExpandoRowPersistence(
94          ExpandoRowPersistence expandoRowPersistence) {
95          this.expandoRowPersistence = expandoRowPersistence;
96      }
97  
98      public ExpandoTableLocalService getExpandoTableLocalService() {
99          return expandoTableLocalService;
100     }
101 
102     public void setExpandoTableLocalService(
103         ExpandoTableLocalService expandoTableLocalService) {
104         this.expandoTableLocalService = expandoTableLocalService;
105     }
106 
107     public ExpandoTablePersistence getExpandoTablePersistence() {
108         return expandoTablePersistence;
109     }
110 
111     public void setExpandoTablePersistence(
112         ExpandoTablePersistence expandoTablePersistence) {
113         this.expandoTablePersistence = expandoTablePersistence;
114     }
115 
116     public ExpandoValueLocalService getExpandoValueLocalService() {
117         return expandoValueLocalService;
118     }
119 
120     public void setExpandoValueLocalService(
121         ExpandoValueLocalService expandoValueLocalService) {
122         this.expandoValueLocalService = expandoValueLocalService;
123     }
124 
125     public ExpandoValueService getExpandoValueService() {
126         return expandoValueService;
127     }
128 
129     public void setExpandoValueService(ExpandoValueService expandoValueService) {
130         this.expandoValueService = expandoValueService;
131     }
132 
133     public ExpandoValuePersistence getExpandoValuePersistence() {
134         return expandoValuePersistence;
135     }
136 
137     public void setExpandoValuePersistence(
138         ExpandoValuePersistence expandoValuePersistence) {
139         this.expandoValuePersistence = expandoValuePersistence;
140     }
141 
142     public CounterLocalService getCounterLocalService() {
143         return counterLocalService;
144     }
145 
146     public void setCounterLocalService(CounterLocalService counterLocalService) {
147         this.counterLocalService = counterLocalService;
148     }
149 
150     public ResourceLocalService getResourceLocalService() {
151         return resourceLocalService;
152     }
153 
154     public void setResourceLocalService(
155         ResourceLocalService resourceLocalService) {
156         this.resourceLocalService = resourceLocalService;
157     }
158 
159     public ResourceService getResourceService() {
160         return resourceService;
161     }
162 
163     public void setResourceService(ResourceService resourceService) {
164         this.resourceService = resourceService;
165     }
166 
167     public ResourcePersistence getResourcePersistence() {
168         return resourcePersistence;
169     }
170 
171     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
172         this.resourcePersistence = resourcePersistence;
173     }
174 
175     public ResourceFinder getResourceFinder() {
176         return resourceFinder;
177     }
178 
179     public void setResourceFinder(ResourceFinder resourceFinder) {
180         this.resourceFinder = resourceFinder;
181     }
182 
183     public UserLocalService getUserLocalService() {
184         return userLocalService;
185     }
186 
187     public void setUserLocalService(UserLocalService userLocalService) {
188         this.userLocalService = userLocalService;
189     }
190 
191     public UserService getUserService() {
192         return userService;
193     }
194 
195     public void setUserService(UserService userService) {
196         this.userService = userService;
197     }
198 
199     public UserPersistence getUserPersistence() {
200         return userPersistence;
201     }
202 
203     public void setUserPersistence(UserPersistence userPersistence) {
204         this.userPersistence = userPersistence;
205     }
206 
207     public UserFinder getUserFinder() {
208         return userFinder;
209     }
210 
211     public void setUserFinder(UserFinder userFinder) {
212         this.userFinder = userFinder;
213     }
214 
215     protected void runSQL(String sql) throws SystemException {
216         try {
217             DataSource dataSource = expandoValuePersistence.getDataSource();
218 
219             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
220                     sql, new int[0]);
221 
222             sqlUpdate.update();
223         }
224         catch (Exception e) {
225             throw new SystemException(e);
226         }
227     }
228 
229     @BeanReference(type = ExpandoColumnLocalService.class)
230     protected ExpandoColumnLocalService expandoColumnLocalService;
231     @BeanReference(type = ExpandoColumnService.class)
232     protected ExpandoColumnService expandoColumnService;
233     @BeanReference(type = ExpandoColumnPersistence.class)
234     protected ExpandoColumnPersistence expandoColumnPersistence;
235     @BeanReference(type = ExpandoRowLocalService.class)
236     protected ExpandoRowLocalService expandoRowLocalService;
237     @BeanReference(type = ExpandoRowPersistence.class)
238     protected ExpandoRowPersistence expandoRowPersistence;
239     @BeanReference(type = ExpandoTableLocalService.class)
240     protected ExpandoTableLocalService expandoTableLocalService;
241     @BeanReference(type = ExpandoTablePersistence.class)
242     protected ExpandoTablePersistence expandoTablePersistence;
243     @BeanReference(type = ExpandoValueLocalService.class)
244     protected ExpandoValueLocalService expandoValueLocalService;
245     @BeanReference(type = ExpandoValueService.class)
246     protected ExpandoValueService expandoValueService;
247     @BeanReference(type = ExpandoValuePersistence.class)
248     protected ExpandoValuePersistence expandoValuePersistence;
249     @BeanReference(type = CounterLocalService.class)
250     protected CounterLocalService counterLocalService;
251     @BeanReference(type = ResourceLocalService.class)
252     protected ResourceLocalService resourceLocalService;
253     @BeanReference(type = ResourceService.class)
254     protected ResourceService resourceService;
255     @BeanReference(type = ResourcePersistence.class)
256     protected ResourcePersistence resourcePersistence;
257     @BeanReference(type = ResourceFinder.class)
258     protected ResourceFinder resourceFinder;
259     @BeanReference(type = UserLocalService.class)
260     protected UserLocalService userLocalService;
261     @BeanReference(type = UserService.class)
262     protected UserService userService;
263     @BeanReference(type = UserPersistence.class)
264     protected UserPersistence userPersistence;
265     @BeanReference(type = UserFinder.class)
266     protected UserFinder userFinder;
267 }