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.softwarecatalog.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.dao.orm.DynamicQuery;
23  import com.liferay.portal.kernel.exception.PortalException;
24  import com.liferay.portal.kernel.exception.SystemException;
25  import com.liferay.portal.kernel.util.OrderByComparator;
26  import com.liferay.portal.service.ImageLocalService;
27  import com.liferay.portal.service.ImageService;
28  import com.liferay.portal.service.ResourceLocalService;
29  import com.liferay.portal.service.ResourceService;
30  import com.liferay.portal.service.UserLocalService;
31  import com.liferay.portal.service.UserService;
32  import com.liferay.portal.service.persistence.ImagePersistence;
33  import com.liferay.portal.service.persistence.ResourceFinder;
34  import com.liferay.portal.service.persistence.ResourcePersistence;
35  import com.liferay.portal.service.persistence.UserFinder;
36  import com.liferay.portal.service.persistence.UserPersistence;
37  
38  import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
39  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalService;
40  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionService;
41  import com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService;
42  import com.liferay.portlet.softwarecatalog.service.SCLicenseService;
43  import com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService;
44  import com.liferay.portlet.softwarecatalog.service.SCProductEntryService;
45  import com.liferay.portlet.softwarecatalog.service.SCProductScreenshotLocalService;
46  import com.liferay.portlet.softwarecatalog.service.SCProductVersionLocalService;
47  import com.liferay.portlet.softwarecatalog.service.SCProductVersionService;
48  import com.liferay.portlet.softwarecatalog.service.persistence.SCFrameworkVersionPersistence;
49  import com.liferay.portlet.softwarecatalog.service.persistence.SCLicensePersistence;
50  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductEntryPersistence;
51  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductScreenshotPersistence;
52  import com.liferay.portlet.softwarecatalog.service.persistence.SCProductVersionPersistence;
53  
54  import java.util.List;
55  
56  import javax.sql.DataSource;
57  
58  /**
59   * <a href="SCProductScreenshotLocalServiceBaseImpl.java.html"><b><i>View Source
60   * </i></b></a>
61   *
62   * @author Brian Wing Shun Chan
63   */
64  public abstract class SCProductScreenshotLocalServiceBaseImpl
65      implements SCProductScreenshotLocalService {
66      public SCProductScreenshot addSCProductScreenshot(
67          SCProductScreenshot scProductScreenshot) throws SystemException {
68          scProductScreenshot.setNew(true);
69  
70          return scProductScreenshotPersistence.update(scProductScreenshot, false);
71      }
72  
73      public SCProductScreenshot createSCProductScreenshot(
74          long productScreenshotId) {
75          return scProductScreenshotPersistence.create(productScreenshotId);
76      }
77  
78      public void deleteSCProductScreenshot(long productScreenshotId)
79          throws PortalException, SystemException {
80          scProductScreenshotPersistence.remove(productScreenshotId);
81      }
82  
83      public void deleteSCProductScreenshot(
84          SCProductScreenshot scProductScreenshot) throws SystemException {
85          scProductScreenshotPersistence.remove(scProductScreenshot);
86      }
87  
88      @SuppressWarnings("unchecked")
89      public List dynamicQuery(DynamicQuery dynamicQuery)
90          throws SystemException {
91          return scProductScreenshotPersistence.findWithDynamicQuery(dynamicQuery);
92      }
93  
94      @SuppressWarnings("unchecked")
95      public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
96          throws SystemException {
97          return scProductScreenshotPersistence.findWithDynamicQuery(dynamicQuery,
98              start, end);
99      }
100 
101     @SuppressWarnings("unchecked")
102     public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
103         OrderByComparator orderByComparator) throws SystemException {
104         return scProductScreenshotPersistence.findWithDynamicQuery(dynamicQuery,
105             start, end, orderByComparator);
106     }
107 
108     public long dynamicQueryCount(DynamicQuery dynamicQuery)
109         throws SystemException {
110         return scProductScreenshotPersistence.countWithDynamicQuery(dynamicQuery);
111     }
112 
113     public SCProductScreenshot getSCProductScreenshot(long productScreenshotId)
114         throws PortalException, SystemException {
115         return scProductScreenshotPersistence.findByPrimaryKey(productScreenshotId);
116     }
117 
118     public List<SCProductScreenshot> getSCProductScreenshots(int start, int end)
119         throws SystemException {
120         return scProductScreenshotPersistence.findAll(start, end);
121     }
122 
123     public int getSCProductScreenshotsCount() throws SystemException {
124         return scProductScreenshotPersistence.countAll();
125     }
126 
127     public SCProductScreenshot updateSCProductScreenshot(
128         SCProductScreenshot scProductScreenshot) throws SystemException {
129         scProductScreenshot.setNew(false);
130 
131         return scProductScreenshotPersistence.update(scProductScreenshot, true);
132     }
133 
134     public SCProductScreenshot updateSCProductScreenshot(
135         SCProductScreenshot scProductScreenshot, boolean merge)
136         throws SystemException {
137         scProductScreenshot.setNew(false);
138 
139         return scProductScreenshotPersistence.update(scProductScreenshot, merge);
140     }
141 
142     public SCLicenseLocalService getSCLicenseLocalService() {
143         return scLicenseLocalService;
144     }
145 
146     public void setSCLicenseLocalService(
147         SCLicenseLocalService scLicenseLocalService) {
148         this.scLicenseLocalService = scLicenseLocalService;
149     }
150 
151     public SCLicenseService getSCLicenseService() {
152         return scLicenseService;
153     }
154 
155     public void setSCLicenseService(SCLicenseService scLicenseService) {
156         this.scLicenseService = scLicenseService;
157     }
158 
159     public SCLicensePersistence getSCLicensePersistence() {
160         return scLicensePersistence;
161     }
162 
163     public void setSCLicensePersistence(
164         SCLicensePersistence scLicensePersistence) {
165         this.scLicensePersistence = scLicensePersistence;
166     }
167 
168     public SCFrameworkVersionLocalService getSCFrameworkVersionLocalService() {
169         return scFrameworkVersionLocalService;
170     }
171 
172     public void setSCFrameworkVersionLocalService(
173         SCFrameworkVersionLocalService scFrameworkVersionLocalService) {
174         this.scFrameworkVersionLocalService = scFrameworkVersionLocalService;
175     }
176 
177     public SCFrameworkVersionService getSCFrameworkVersionService() {
178         return scFrameworkVersionService;
179     }
180 
181     public void setSCFrameworkVersionService(
182         SCFrameworkVersionService scFrameworkVersionService) {
183         this.scFrameworkVersionService = scFrameworkVersionService;
184     }
185 
186     public SCFrameworkVersionPersistence getSCFrameworkVersionPersistence() {
187         return scFrameworkVersionPersistence;
188     }
189 
190     public void setSCFrameworkVersionPersistence(
191         SCFrameworkVersionPersistence scFrameworkVersionPersistence) {
192         this.scFrameworkVersionPersistence = scFrameworkVersionPersistence;
193     }
194 
195     public SCProductEntryLocalService getSCProductEntryLocalService() {
196         return scProductEntryLocalService;
197     }
198 
199     public void setSCProductEntryLocalService(
200         SCProductEntryLocalService scProductEntryLocalService) {
201         this.scProductEntryLocalService = scProductEntryLocalService;
202     }
203 
204     public SCProductEntryService getSCProductEntryService() {
205         return scProductEntryService;
206     }
207 
208     public void setSCProductEntryService(
209         SCProductEntryService scProductEntryService) {
210         this.scProductEntryService = scProductEntryService;
211     }
212 
213     public SCProductEntryPersistence getSCProductEntryPersistence() {
214         return scProductEntryPersistence;
215     }
216 
217     public void setSCProductEntryPersistence(
218         SCProductEntryPersistence scProductEntryPersistence) {
219         this.scProductEntryPersistence = scProductEntryPersistence;
220     }
221 
222     public SCProductScreenshotLocalService getSCProductScreenshotLocalService() {
223         return scProductScreenshotLocalService;
224     }
225 
226     public void setSCProductScreenshotLocalService(
227         SCProductScreenshotLocalService scProductScreenshotLocalService) {
228         this.scProductScreenshotLocalService = scProductScreenshotLocalService;
229     }
230 
231     public SCProductScreenshotPersistence getSCProductScreenshotPersistence() {
232         return scProductScreenshotPersistence;
233     }
234 
235     public void setSCProductScreenshotPersistence(
236         SCProductScreenshotPersistence scProductScreenshotPersistence) {
237         this.scProductScreenshotPersistence = scProductScreenshotPersistence;
238     }
239 
240     public SCProductVersionLocalService getSCProductVersionLocalService() {
241         return scProductVersionLocalService;
242     }
243 
244     public void setSCProductVersionLocalService(
245         SCProductVersionLocalService scProductVersionLocalService) {
246         this.scProductVersionLocalService = scProductVersionLocalService;
247     }
248 
249     public SCProductVersionService getSCProductVersionService() {
250         return scProductVersionService;
251     }
252 
253     public void setSCProductVersionService(
254         SCProductVersionService scProductVersionService) {
255         this.scProductVersionService = scProductVersionService;
256     }
257 
258     public SCProductVersionPersistence getSCProductVersionPersistence() {
259         return scProductVersionPersistence;
260     }
261 
262     public void setSCProductVersionPersistence(
263         SCProductVersionPersistence scProductVersionPersistence) {
264         this.scProductVersionPersistence = scProductVersionPersistence;
265     }
266 
267     public CounterLocalService getCounterLocalService() {
268         return counterLocalService;
269     }
270 
271     public void setCounterLocalService(CounterLocalService counterLocalService) {
272         this.counterLocalService = counterLocalService;
273     }
274 
275     public ImageLocalService getImageLocalService() {
276         return imageLocalService;
277     }
278 
279     public void setImageLocalService(ImageLocalService imageLocalService) {
280         this.imageLocalService = imageLocalService;
281     }
282 
283     public ImageService getImageService() {
284         return imageService;
285     }
286 
287     public void setImageService(ImageService imageService) {
288         this.imageService = imageService;
289     }
290 
291     public ImagePersistence getImagePersistence() {
292         return imagePersistence;
293     }
294 
295     public void setImagePersistence(ImagePersistence imagePersistence) {
296         this.imagePersistence = imagePersistence;
297     }
298 
299     public ResourceLocalService getResourceLocalService() {
300         return resourceLocalService;
301     }
302 
303     public void setResourceLocalService(
304         ResourceLocalService resourceLocalService) {
305         this.resourceLocalService = resourceLocalService;
306     }
307 
308     public ResourceService getResourceService() {
309         return resourceService;
310     }
311 
312     public void setResourceService(ResourceService resourceService) {
313         this.resourceService = resourceService;
314     }
315 
316     public ResourcePersistence getResourcePersistence() {
317         return resourcePersistence;
318     }
319 
320     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
321         this.resourcePersistence = resourcePersistence;
322     }
323 
324     public ResourceFinder getResourceFinder() {
325         return resourceFinder;
326     }
327 
328     public void setResourceFinder(ResourceFinder resourceFinder) {
329         this.resourceFinder = resourceFinder;
330     }
331 
332     public UserLocalService getUserLocalService() {
333         return userLocalService;
334     }
335 
336     public void setUserLocalService(UserLocalService userLocalService) {
337         this.userLocalService = userLocalService;
338     }
339 
340     public UserService getUserService() {
341         return userService;
342     }
343 
344     public void setUserService(UserService userService) {
345         this.userService = userService;
346     }
347 
348     public UserPersistence getUserPersistence() {
349         return userPersistence;
350     }
351 
352     public void setUserPersistence(UserPersistence userPersistence) {
353         this.userPersistence = userPersistence;
354     }
355 
356     public UserFinder getUserFinder() {
357         return userFinder;
358     }
359 
360     public void setUserFinder(UserFinder userFinder) {
361         this.userFinder = userFinder;
362     }
363 
364     protected void runSQL(String sql) throws SystemException {
365         try {
366             DataSource dataSource = scProductScreenshotPersistence.getDataSource();
367 
368             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
369                     sql, new int[0]);
370 
371             sqlUpdate.update();
372         }
373         catch (Exception e) {
374             throw new SystemException(e);
375         }
376     }
377 
378     @BeanReference(type = SCLicenseLocalService.class)
379     protected SCLicenseLocalService scLicenseLocalService;
380     @BeanReference(type = SCLicenseService.class)
381     protected SCLicenseService scLicenseService;
382     @BeanReference(type = SCLicensePersistence.class)
383     protected SCLicensePersistence scLicensePersistence;
384     @BeanReference(type = SCFrameworkVersionLocalService.class)
385     protected SCFrameworkVersionLocalService scFrameworkVersionLocalService;
386     @BeanReference(type = SCFrameworkVersionService.class)
387     protected SCFrameworkVersionService scFrameworkVersionService;
388     @BeanReference(type = SCFrameworkVersionPersistence.class)
389     protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
390     @BeanReference(type = SCProductEntryLocalService.class)
391     protected SCProductEntryLocalService scProductEntryLocalService;
392     @BeanReference(type = SCProductEntryService.class)
393     protected SCProductEntryService scProductEntryService;
394     @BeanReference(type = SCProductEntryPersistence.class)
395     protected SCProductEntryPersistence scProductEntryPersistence;
396     @BeanReference(type = SCProductScreenshotLocalService.class)
397     protected SCProductScreenshotLocalService scProductScreenshotLocalService;
398     @BeanReference(type = SCProductScreenshotPersistence.class)
399     protected SCProductScreenshotPersistence scProductScreenshotPersistence;
400     @BeanReference(type = SCProductVersionLocalService.class)
401     protected SCProductVersionLocalService scProductVersionLocalService;
402     @BeanReference(type = SCProductVersionService.class)
403     protected SCProductVersionService scProductVersionService;
404     @BeanReference(type = SCProductVersionPersistence.class)
405     protected SCProductVersionPersistence scProductVersionPersistence;
406     @BeanReference(type = CounterLocalService.class)
407     protected CounterLocalService counterLocalService;
408     @BeanReference(type = ImageLocalService.class)
409     protected ImageLocalService imageLocalService;
410     @BeanReference(type = ImageService.class)
411     protected ImageService imageService;
412     @BeanReference(type = ImagePersistence.class)
413     protected ImagePersistence imagePersistence;
414     @BeanReference(type = ResourceLocalService.class)
415     protected ResourceLocalService resourceLocalService;
416     @BeanReference(type = ResourceService.class)
417     protected ResourceService resourceService;
418     @BeanReference(type = ResourcePersistence.class)
419     protected ResourcePersistence resourcePersistence;
420     @BeanReference(type = ResourceFinder.class)
421     protected ResourceFinder resourceFinder;
422     @BeanReference(type = UserLocalService.class)
423     protected UserLocalService userLocalService;
424     @BeanReference(type = UserService.class)
425     protected UserService userService;
426     @BeanReference(type = UserPersistence.class)
427     protected UserPersistence userPersistence;
428     @BeanReference(type = UserFinder.class)
429     protected UserFinder userFinder;
430 }