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.dao.db.DB;
019    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.exception.SystemException;
023    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
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, IdentifiableOSGiService {
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 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(TrashEntryService trashEntryService) {
094                    this.trashEntryService = trashEntryService;
095            }
096    
097            /**
098             * Returns the trash entry persistence.
099             *
100             * @return the trash entry persistence
101             */
102            public TrashEntryPersistence getTrashEntryPersistence() {
103                    return trashEntryPersistence;
104            }
105    
106            /**
107             * Sets the trash entry persistence.
108             *
109             * @param trashEntryPersistence the trash entry persistence
110             */
111            public void setTrashEntryPersistence(
112                    TrashEntryPersistence trashEntryPersistence) {
113                    this.trashEntryPersistence = trashEntryPersistence;
114            }
115    
116            /**
117             * Returns the trash version local service.
118             *
119             * @return the trash version local service
120             */
121            public com.liferay.portlet.trash.service.TrashVersionLocalService getTrashVersionLocalService() {
122                    return trashVersionLocalService;
123            }
124    
125            /**
126             * Sets the trash version local service.
127             *
128             * @param trashVersionLocalService the trash version local service
129             */
130            public void setTrashVersionLocalService(
131                    com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService) {
132                    this.trashVersionLocalService = trashVersionLocalService;
133            }
134    
135            /**
136             * Returns the trash version persistence.
137             *
138             * @return the trash version persistence
139             */
140            public TrashVersionPersistence getTrashVersionPersistence() {
141                    return trashVersionPersistence;
142            }
143    
144            /**
145             * Sets the trash version persistence.
146             *
147             * @param trashVersionPersistence the trash version persistence
148             */
149            public void setTrashVersionPersistence(
150                    TrashVersionPersistence trashVersionPersistence) {
151                    this.trashVersionPersistence = trashVersionPersistence;
152            }
153    
154            /**
155             * Returns the counter local service.
156             *
157             * @return the counter local service
158             */
159            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
160                    return counterLocalService;
161            }
162    
163            /**
164             * Sets the counter local service.
165             *
166             * @param counterLocalService the counter local service
167             */
168            public void setCounterLocalService(
169                    com.liferay.counter.service.CounterLocalService counterLocalService) {
170                    this.counterLocalService = counterLocalService;
171            }
172    
173            /**
174             * Returns the class name local service.
175             *
176             * @return the class name local service
177             */
178            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
179                    return classNameLocalService;
180            }
181    
182            /**
183             * Sets the class name local service.
184             *
185             * @param classNameLocalService the class name local service
186             */
187            public void setClassNameLocalService(
188                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
189                    this.classNameLocalService = classNameLocalService;
190            }
191    
192            /**
193             * Returns the class name remote service.
194             *
195             * @return the class name remote service
196             */
197            public com.liferay.portal.service.ClassNameService getClassNameService() {
198                    return classNameService;
199            }
200    
201            /**
202             * Sets the class name remote service.
203             *
204             * @param classNameService the class name remote service
205             */
206            public void setClassNameService(
207                    com.liferay.portal.service.ClassNameService classNameService) {
208                    this.classNameService = classNameService;
209            }
210    
211            /**
212             * Returns the class name persistence.
213             *
214             * @return the class name persistence
215             */
216            public ClassNamePersistence getClassNamePersistence() {
217                    return classNamePersistence;
218            }
219    
220            /**
221             * Sets the class name persistence.
222             *
223             * @param classNamePersistence the class name persistence
224             */
225            public void setClassNamePersistence(
226                    ClassNamePersistence classNamePersistence) {
227                    this.classNamePersistence = classNamePersistence;
228            }
229    
230            /**
231             * Returns the group local service.
232             *
233             * @return the group local service
234             */
235            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
236                    return groupLocalService;
237            }
238    
239            /**
240             * Sets the group local service.
241             *
242             * @param groupLocalService the group local service
243             */
244            public void setGroupLocalService(
245                    com.liferay.portal.service.GroupLocalService groupLocalService) {
246                    this.groupLocalService = groupLocalService;
247            }
248    
249            /**
250             * Returns the group remote service.
251             *
252             * @return the group remote service
253             */
254            public com.liferay.portal.service.GroupService getGroupService() {
255                    return groupService;
256            }
257    
258            /**
259             * Sets the group remote service.
260             *
261             * @param groupService the group remote service
262             */
263            public void setGroupService(
264                    com.liferay.portal.service.GroupService groupService) {
265                    this.groupService = groupService;
266            }
267    
268            /**
269             * Returns the group persistence.
270             *
271             * @return the group persistence
272             */
273            public GroupPersistence getGroupPersistence() {
274                    return groupPersistence;
275            }
276    
277            /**
278             * Sets the group persistence.
279             *
280             * @param groupPersistence the group persistence
281             */
282            public void setGroupPersistence(GroupPersistence groupPersistence) {
283                    this.groupPersistence = groupPersistence;
284            }
285    
286            /**
287             * Returns the group finder.
288             *
289             * @return the group finder
290             */
291            public GroupFinder getGroupFinder() {
292                    return groupFinder;
293            }
294    
295            /**
296             * Sets the group finder.
297             *
298             * @param groupFinder the group finder
299             */
300            public void setGroupFinder(GroupFinder groupFinder) {
301                    this.groupFinder = groupFinder;
302            }
303    
304            /**
305             * Returns the resource local service.
306             *
307             * @return the resource local service
308             */
309            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
310                    return resourceLocalService;
311            }
312    
313            /**
314             * Sets the resource local service.
315             *
316             * @param resourceLocalService the resource local service
317             */
318            public void setResourceLocalService(
319                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
320                    this.resourceLocalService = resourceLocalService;
321            }
322    
323            /**
324             * Returns the system event local service.
325             *
326             * @return the system event local service
327             */
328            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
329                    return systemEventLocalService;
330            }
331    
332            /**
333             * Sets the system event local service.
334             *
335             * @param systemEventLocalService the system event local service
336             */
337            public void setSystemEventLocalService(
338                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
339                    this.systemEventLocalService = systemEventLocalService;
340            }
341    
342            /**
343             * Returns the system event persistence.
344             *
345             * @return the system event persistence
346             */
347            public SystemEventPersistence getSystemEventPersistence() {
348                    return systemEventPersistence;
349            }
350    
351            /**
352             * Sets the system event persistence.
353             *
354             * @param systemEventPersistence the system event persistence
355             */
356            public void setSystemEventPersistence(
357                    SystemEventPersistence systemEventPersistence) {
358                    this.systemEventPersistence = systemEventPersistence;
359            }
360    
361            /**
362             * Returns the user local service.
363             *
364             * @return the user local service
365             */
366            public com.liferay.portal.service.UserLocalService getUserLocalService() {
367                    return userLocalService;
368            }
369    
370            /**
371             * Sets the user local service.
372             *
373             * @param userLocalService the user local service
374             */
375            public void setUserLocalService(
376                    com.liferay.portal.service.UserLocalService userLocalService) {
377                    this.userLocalService = userLocalService;
378            }
379    
380            /**
381             * Returns the user remote service.
382             *
383             * @return the user remote service
384             */
385            public com.liferay.portal.service.UserService getUserService() {
386                    return userService;
387            }
388    
389            /**
390             * Sets the user remote service.
391             *
392             * @param userService the user remote service
393             */
394            public void setUserService(
395                    com.liferay.portal.service.UserService userService) {
396                    this.userService = userService;
397            }
398    
399            /**
400             * Returns the user persistence.
401             *
402             * @return the user persistence
403             */
404            public UserPersistence getUserPersistence() {
405                    return userPersistence;
406            }
407    
408            /**
409             * Sets the user persistence.
410             *
411             * @param userPersistence the user persistence
412             */
413            public void setUserPersistence(UserPersistence userPersistence) {
414                    this.userPersistence = userPersistence;
415            }
416    
417            /**
418             * Returns the user finder.
419             *
420             * @return the user finder
421             */
422            public UserFinder getUserFinder() {
423                    return userFinder;
424            }
425    
426            /**
427             * Sets the user finder.
428             *
429             * @param userFinder the user finder
430             */
431            public void setUserFinder(UserFinder userFinder) {
432                    this.userFinder = userFinder;
433            }
434    
435            public void afterPropertiesSet() {
436            }
437    
438            public void destroy() {
439            }
440    
441            /**
442             * Returns the OSGi service identifier.
443             *
444             * @return the OSGi service identifier
445             */
446            @Override
447            public String getOSGiServiceIdentifier() {
448                    return TrashEntryService.class.getName();
449            }
450    
451            protected Class<?> getModelClass() {
452                    return TrashEntry.class;
453            }
454    
455            protected String getModelClassName() {
456                    return TrashEntry.class.getName();
457            }
458    
459            /**
460             * Performs a SQL query.
461             *
462             * @param sql the sql query
463             */
464            protected void runSQL(String sql) {
465                    try {
466                            DataSource dataSource = trashEntryPersistence.getDataSource();
467    
468                            DB db = DBManagerUtil.getDB();
469    
470                            sql = db.buildSQL(sql);
471                            sql = PortalUtil.transformSQL(sql);
472    
473                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
474                                            sql, new int[0]);
475    
476                            sqlUpdate.update();
477                    }
478                    catch (Exception e) {
479                            throw new SystemException(e);
480                    }
481            }
482    
483            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
484            protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
485            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryService.class)
486            protected TrashEntryService trashEntryService;
487            @BeanReference(type = TrashEntryPersistence.class)
488            protected TrashEntryPersistence trashEntryPersistence;
489            @BeanReference(type = com.liferay.portlet.trash.service.TrashVersionLocalService.class)
490            protected com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService;
491            @BeanReference(type = TrashVersionPersistence.class)
492            protected TrashVersionPersistence trashVersionPersistence;
493            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
494            protected com.liferay.counter.service.CounterLocalService counterLocalService;
495            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
496            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
497            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
498            protected com.liferay.portal.service.ClassNameService classNameService;
499            @BeanReference(type = ClassNamePersistence.class)
500            protected ClassNamePersistence classNamePersistence;
501            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
502            protected com.liferay.portal.service.GroupLocalService groupLocalService;
503            @BeanReference(type = com.liferay.portal.service.GroupService.class)
504            protected com.liferay.portal.service.GroupService groupService;
505            @BeanReference(type = GroupPersistence.class)
506            protected GroupPersistence groupPersistence;
507            @BeanReference(type = GroupFinder.class)
508            protected GroupFinder groupFinder;
509            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
510            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
511            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
512            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
513            @BeanReference(type = SystemEventPersistence.class)
514            protected SystemEventPersistence systemEventPersistence;
515            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
516            protected com.liferay.portal.service.UserLocalService userLocalService;
517            @BeanReference(type = com.liferay.portal.service.UserService.class)
518            protected com.liferay.portal.service.UserService userService;
519            @BeanReference(type = UserPersistence.class)
520            protected UserPersistence userPersistence;
521            @BeanReference(type = UserFinder.class)
522            protected UserFinder userFinder;
523    }