001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.trash.service.base;
016    
017    import com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.bean.IdentifiableBean;
019    import com.liferay.portal.kernel.dao.db.DB;
020    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023    import com.liferay.portal.kernel.exception.SystemException;
024    import com.liferay.portal.service.BaseServiceImpl;
025    import com.liferay.portal.service.persistence.ClassNamePersistence;
026    import com.liferay.portal.service.persistence.GroupFinder;
027    import com.liferay.portal.service.persistence.GroupPersistence;
028    import com.liferay.portal.service.persistence.SystemEventPersistence;
029    import com.liferay.portal.service.persistence.UserFinder;
030    import com.liferay.portal.service.persistence.UserPersistence;
031    import com.liferay.portal.util.PortalUtil;
032    
033    import com.liferay.portlet.trash.model.TrashEntry;
034    import com.liferay.portlet.trash.service.TrashEntryService;
035    import com.liferay.portlet.trash.service.persistence.TrashEntryPersistence;
036    import com.liferay.portlet.trash.service.persistence.TrashVersionPersistence;
037    
038    import javax.sql.DataSource;
039    
040    /**
041     * Provides the base implementation for the trash entry remote service.
042     *
043     * <p>
044     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portlet.trash.service.impl.TrashEntryServiceImpl}.
045     * </p>
046     *
047     * @author Brian Wing Shun Chan
048     * @see com.liferay.portlet.trash.service.impl.TrashEntryServiceImpl
049     * @see com.liferay.portlet.trash.service.TrashEntryServiceUtil
050     * @generated
051     */
052    public abstract class TrashEntryServiceBaseImpl extends BaseServiceImpl
053            implements TrashEntryService, IdentifiableBean {
054            /*
055             * NOTE FOR DEVELOPERS:
056             *
057             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.trash.service.TrashEntryServiceUtil} to access the trash entry remote service.
058             */
059    
060            /**
061             * Returns the trash entry local service.
062             *
063             * @return the trash entry local service
064             */
065            public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
066                    return trashEntryLocalService;
067            }
068    
069            /**
070             * Sets the trash entry local service.
071             *
072             * @param trashEntryLocalService the trash entry local service
073             */
074            public void setTrashEntryLocalService(
075                    com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
076                    this.trashEntryLocalService = trashEntryLocalService;
077            }
078    
079            /**
080             * Returns the trash entry remote service.
081             *
082             * @return the trash entry remote service
083             */
084            public com.liferay.portlet.trash.service.TrashEntryService getTrashEntryService() {
085                    return trashEntryService;
086            }
087    
088            /**
089             * Sets the trash entry remote service.
090             *
091             * @param trashEntryService the trash entry remote service
092             */
093            public void setTrashEntryService(
094                    com.liferay.portlet.trash.service.TrashEntryService trashEntryService) {
095                    this.trashEntryService = trashEntryService;
096            }
097    
098            /**
099             * Returns the trash entry persistence.
100             *
101             * @return the trash entry persistence
102             */
103            public TrashEntryPersistence getTrashEntryPersistence() {
104                    return trashEntryPersistence;
105            }
106    
107            /**
108             * Sets the trash entry persistence.
109             *
110             * @param trashEntryPersistence the trash entry persistence
111             */
112            public void setTrashEntryPersistence(
113                    TrashEntryPersistence trashEntryPersistence) {
114                    this.trashEntryPersistence = trashEntryPersistence;
115            }
116    
117            /**
118             * Returns the trash version local service.
119             *
120             * @return the trash version local service
121             */
122            public com.liferay.portlet.trash.service.TrashVersionLocalService getTrashVersionLocalService() {
123                    return trashVersionLocalService;
124            }
125    
126            /**
127             * Sets the trash version local service.
128             *
129             * @param trashVersionLocalService the trash version local service
130             */
131            public void setTrashVersionLocalService(
132                    com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService) {
133                    this.trashVersionLocalService = trashVersionLocalService;
134            }
135    
136            /**
137             * Returns the trash version persistence.
138             *
139             * @return the trash version persistence
140             */
141            public TrashVersionPersistence getTrashVersionPersistence() {
142                    return trashVersionPersistence;
143            }
144    
145            /**
146             * Sets the trash version persistence.
147             *
148             * @param trashVersionPersistence the trash version persistence
149             */
150            public void setTrashVersionPersistence(
151                    TrashVersionPersistence trashVersionPersistence) {
152                    this.trashVersionPersistence = trashVersionPersistence;
153            }
154    
155            /**
156             * Returns the counter local service.
157             *
158             * @return the counter local service
159             */
160            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
161                    return counterLocalService;
162            }
163    
164            /**
165             * Sets the counter local service.
166             *
167             * @param counterLocalService the counter local service
168             */
169            public void setCounterLocalService(
170                    com.liferay.counter.service.CounterLocalService counterLocalService) {
171                    this.counterLocalService = counterLocalService;
172            }
173    
174            /**
175             * Returns the class name local service.
176             *
177             * @return the class name local service
178             */
179            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
180                    return classNameLocalService;
181            }
182    
183            /**
184             * Sets the class name local service.
185             *
186             * @param classNameLocalService the class name local service
187             */
188            public void setClassNameLocalService(
189                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
190                    this.classNameLocalService = classNameLocalService;
191            }
192    
193            /**
194             * Returns the class name remote service.
195             *
196             * @return the class name remote service
197             */
198            public com.liferay.portal.service.ClassNameService getClassNameService() {
199                    return classNameService;
200            }
201    
202            /**
203             * Sets the class name remote service.
204             *
205             * @param classNameService the class name remote service
206             */
207            public void setClassNameService(
208                    com.liferay.portal.service.ClassNameService classNameService) {
209                    this.classNameService = classNameService;
210            }
211    
212            /**
213             * Returns the class name persistence.
214             *
215             * @return the class name persistence
216             */
217            public ClassNamePersistence getClassNamePersistence() {
218                    return classNamePersistence;
219            }
220    
221            /**
222             * Sets the class name persistence.
223             *
224             * @param classNamePersistence the class name persistence
225             */
226            public void setClassNamePersistence(
227                    ClassNamePersistence classNamePersistence) {
228                    this.classNamePersistence = classNamePersistence;
229            }
230    
231            /**
232             * Returns the group local service.
233             *
234             * @return the group local service
235             */
236            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
237                    return groupLocalService;
238            }
239    
240            /**
241             * Sets the group local service.
242             *
243             * @param groupLocalService the group local service
244             */
245            public void setGroupLocalService(
246                    com.liferay.portal.service.GroupLocalService groupLocalService) {
247                    this.groupLocalService = groupLocalService;
248            }
249    
250            /**
251             * Returns the group remote service.
252             *
253             * @return the group remote service
254             */
255            public com.liferay.portal.service.GroupService getGroupService() {
256                    return groupService;
257            }
258    
259            /**
260             * Sets the group remote service.
261             *
262             * @param groupService the group remote service
263             */
264            public void setGroupService(
265                    com.liferay.portal.service.GroupService groupService) {
266                    this.groupService = groupService;
267            }
268    
269            /**
270             * Returns the group persistence.
271             *
272             * @return the group persistence
273             */
274            public GroupPersistence getGroupPersistence() {
275                    return groupPersistence;
276            }
277    
278            /**
279             * Sets the group persistence.
280             *
281             * @param groupPersistence the group persistence
282             */
283            public void setGroupPersistence(GroupPersistence groupPersistence) {
284                    this.groupPersistence = groupPersistence;
285            }
286    
287            /**
288             * Returns the group finder.
289             *
290             * @return the group finder
291             */
292            public GroupFinder getGroupFinder() {
293                    return groupFinder;
294            }
295    
296            /**
297             * Sets the group finder.
298             *
299             * @param groupFinder the group finder
300             */
301            public void setGroupFinder(GroupFinder groupFinder) {
302                    this.groupFinder = groupFinder;
303            }
304    
305            /**
306             * Returns the resource local service.
307             *
308             * @return the resource local service
309             */
310            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
311                    return resourceLocalService;
312            }
313    
314            /**
315             * Sets the resource local service.
316             *
317             * @param resourceLocalService the resource local service
318             */
319            public void setResourceLocalService(
320                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
321                    this.resourceLocalService = resourceLocalService;
322            }
323    
324            /**
325             * Returns the system event local service.
326             *
327             * @return the system event local service
328             */
329            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
330                    return systemEventLocalService;
331            }
332    
333            /**
334             * Sets the system event local service.
335             *
336             * @param systemEventLocalService the system event local service
337             */
338            public void setSystemEventLocalService(
339                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
340                    this.systemEventLocalService = systemEventLocalService;
341            }
342    
343            /**
344             * Returns the system event persistence.
345             *
346             * @return the system event persistence
347             */
348            public SystemEventPersistence getSystemEventPersistence() {
349                    return systemEventPersistence;
350            }
351    
352            /**
353             * Sets the system event persistence.
354             *
355             * @param systemEventPersistence the system event persistence
356             */
357            public void setSystemEventPersistence(
358                    SystemEventPersistence systemEventPersistence) {
359                    this.systemEventPersistence = systemEventPersistence;
360            }
361    
362            /**
363             * Returns the user local service.
364             *
365             * @return the user local service
366             */
367            public com.liferay.portal.service.UserLocalService getUserLocalService() {
368                    return userLocalService;
369            }
370    
371            /**
372             * Sets the user local service.
373             *
374             * @param userLocalService the user local service
375             */
376            public void setUserLocalService(
377                    com.liferay.portal.service.UserLocalService userLocalService) {
378                    this.userLocalService = userLocalService;
379            }
380    
381            /**
382             * Returns the user remote service.
383             *
384             * @return the user remote service
385             */
386            public com.liferay.portal.service.UserService getUserService() {
387                    return userService;
388            }
389    
390            /**
391             * Sets the user remote service.
392             *
393             * @param userService the user remote service
394             */
395            public void setUserService(
396                    com.liferay.portal.service.UserService userService) {
397                    this.userService = userService;
398            }
399    
400            /**
401             * Returns the user persistence.
402             *
403             * @return the user persistence
404             */
405            public UserPersistence getUserPersistence() {
406                    return userPersistence;
407            }
408    
409            /**
410             * Sets the user persistence.
411             *
412             * @param userPersistence the user persistence
413             */
414            public void setUserPersistence(UserPersistence userPersistence) {
415                    this.userPersistence = userPersistence;
416            }
417    
418            /**
419             * Returns the user finder.
420             *
421             * @return the user finder
422             */
423            public UserFinder getUserFinder() {
424                    return userFinder;
425            }
426    
427            /**
428             * Sets the user finder.
429             *
430             * @param userFinder the user finder
431             */
432            public void setUserFinder(UserFinder userFinder) {
433                    this.userFinder = userFinder;
434            }
435    
436            public void afterPropertiesSet() {
437            }
438    
439            public void destroy() {
440            }
441    
442            /**
443             * Returns the Spring bean ID for this bean.
444             *
445             * @return the Spring bean ID for this bean
446             */
447            @Override
448            public String getBeanIdentifier() {
449                    return _beanIdentifier;
450            }
451    
452            /**
453             * Sets the Spring bean ID for this bean.
454             *
455             * @param beanIdentifier the Spring bean ID for this bean
456             */
457            @Override
458            public void setBeanIdentifier(String beanIdentifier) {
459                    _beanIdentifier = beanIdentifier;
460            }
461    
462            protected Class<?> getModelClass() {
463                    return TrashEntry.class;
464            }
465    
466            protected String getModelClassName() {
467                    return TrashEntry.class.getName();
468            }
469    
470            /**
471             * Performs a SQL query.
472             *
473             * @param sql the sql query
474             */
475            protected void runSQL(String sql) {
476                    try {
477                            DataSource dataSource = trashEntryPersistence.getDataSource();
478    
479                            DB db = DBFactoryUtil.getDB();
480    
481                            sql = db.buildSQL(sql);
482                            sql = PortalUtil.transformSQL(sql);
483    
484                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
485                                            sql, new int[0]);
486    
487                            sqlUpdate.update();
488                    }
489                    catch (Exception e) {
490                            throw new SystemException(e);
491                    }
492            }
493    
494            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
495            protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
496            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryService.class)
497            protected com.liferay.portlet.trash.service.TrashEntryService trashEntryService;
498            @BeanReference(type = TrashEntryPersistence.class)
499            protected TrashEntryPersistence trashEntryPersistence;
500            @BeanReference(type = com.liferay.portlet.trash.service.TrashVersionLocalService.class)
501            protected com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService;
502            @BeanReference(type = TrashVersionPersistence.class)
503            protected TrashVersionPersistence trashVersionPersistence;
504            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
505            protected com.liferay.counter.service.CounterLocalService counterLocalService;
506            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
507            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
508            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
509            protected com.liferay.portal.service.ClassNameService classNameService;
510            @BeanReference(type = ClassNamePersistence.class)
511            protected ClassNamePersistence classNamePersistence;
512            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
513            protected com.liferay.portal.service.GroupLocalService groupLocalService;
514            @BeanReference(type = com.liferay.portal.service.GroupService.class)
515            protected com.liferay.portal.service.GroupService groupService;
516            @BeanReference(type = GroupPersistence.class)
517            protected GroupPersistence groupPersistence;
518            @BeanReference(type = GroupFinder.class)
519            protected GroupFinder groupFinder;
520            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
521            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
522            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
523            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
524            @BeanReference(type = SystemEventPersistence.class)
525            protected SystemEventPersistence systemEventPersistence;
526            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
527            protected com.liferay.portal.service.UserLocalService userLocalService;
528            @BeanReference(type = com.liferay.portal.service.UserService.class)
529            protected com.liferay.portal.service.UserService userService;
530            @BeanReference(type = UserPersistence.class)
531            protected UserPersistence userPersistence;
532            @BeanReference(type = UserFinder.class)
533            protected UserFinder userFinder;
534            private String _beanIdentifier;
535    }