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