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