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.portal.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
033    import com.liferay.portal.kernel.search.Indexable;
034    import com.liferay.portal.kernel.search.IndexableType;
035    import com.liferay.portal.kernel.util.OrderByComparator;
036    import com.liferay.portal.model.PersistedModel;
037    import com.liferay.portal.model.Portlet;
038    import com.liferay.portal.service.BaseLocalServiceImpl;
039    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
040    import com.liferay.portal.service.PortletLocalService;
041    import com.liferay.portal.service.persistence.PortletPersistence;
042    import com.liferay.portal.service.persistence.PortletPreferencesFinder;
043    import com.liferay.portal.service.persistence.PortletPreferencesPersistence;
044    import com.liferay.portal.service.persistence.ResourceActionPersistence;
045    import com.liferay.portal.service.persistence.ResourceBlockFinder;
046    import com.liferay.portal.service.persistence.ResourceBlockPersistence;
047    import com.liferay.portal.service.persistence.ResourcePermissionFinder;
048    import com.liferay.portal.service.persistence.ResourcePermissionPersistence;
049    import com.liferay.portal.service.persistence.RoleFinder;
050    import com.liferay.portal.service.persistence.RolePersistence;
051    import com.liferay.portal.util.PortalUtil;
052    
053    import java.io.Serializable;
054    
055    import java.util.List;
056    
057    import javax.sql.DataSource;
058    
059    /**
060     * Provides the base implementation for the portlet local service.
061     *
062     * <p>
063     * 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.portal.service.impl.PortletLocalServiceImpl}.
064     * </p>
065     *
066     * @author Brian Wing Shun Chan
067     * @see com.liferay.portal.service.impl.PortletLocalServiceImpl
068     * @see com.liferay.portal.service.PortletLocalServiceUtil
069     * @generated
070     */
071    @ProviderType
072    public abstract class PortletLocalServiceBaseImpl extends BaseLocalServiceImpl
073            implements PortletLocalService, IdentifiableOSGiService {
074            /*
075             * NOTE FOR DEVELOPERS:
076             *
077             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.PortletLocalServiceUtil} to access the portlet local service.
078             */
079    
080            /**
081             * Adds the portlet to the database. Also notifies the appropriate model listeners.
082             *
083             * @param portlet the portlet
084             * @return the portlet that was added
085             */
086            @Indexable(type = IndexableType.REINDEX)
087            @Override
088            public Portlet addPortlet(Portlet portlet) {
089                    portlet.setNew(true);
090    
091                    return portletPersistence.update(portlet);
092            }
093    
094            /**
095             * Creates a new portlet with the primary key. Does not add the portlet to the database.
096             *
097             * @param id the primary key for the new portlet
098             * @return the new portlet
099             */
100            @Override
101            public Portlet createPortlet(long id) {
102                    return portletPersistence.create(id);
103            }
104    
105            /**
106             * Deletes the portlet with the primary key from the database. Also notifies the appropriate model listeners.
107             *
108             * @param id the primary key of the portlet
109             * @return the portlet that was removed
110             * @throws PortalException if a portlet with the primary key could not be found
111             */
112            @Indexable(type = IndexableType.DELETE)
113            @Override
114            public Portlet deletePortlet(long id) throws PortalException {
115                    return portletPersistence.remove(id);
116            }
117    
118            /**
119             * Deletes the portlet from the database. Also notifies the appropriate model listeners.
120             *
121             * @param portlet the portlet
122             * @return the portlet that was removed
123             */
124            @Indexable(type = IndexableType.DELETE)
125            @Override
126            public Portlet deletePortlet(Portlet portlet) {
127                    return portletPersistence.remove(portlet);
128            }
129    
130            @Override
131            public DynamicQuery dynamicQuery() {
132                    Class<?> clazz = getClass();
133    
134                    return DynamicQueryFactoryUtil.forClass(Portlet.class,
135                            clazz.getClassLoader());
136            }
137    
138            /**
139             * Performs a dynamic query on the database and returns the matching rows.
140             *
141             * @param dynamicQuery the dynamic query
142             * @return the matching rows
143             */
144            @Override
145            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
146                    return portletPersistence.findWithDynamicQuery(dynamicQuery);
147            }
148    
149            /**
150             * Performs a dynamic query on the database and returns a range of the matching rows.
151             *
152             * <p>
153             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PortletModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
154             * </p>
155             *
156             * @param dynamicQuery the dynamic query
157             * @param start the lower bound of the range of model instances
158             * @param end the upper bound of the range of model instances (not inclusive)
159             * @return the range of matching rows
160             */
161            @Override
162            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
163                    int end) {
164                    return portletPersistence.findWithDynamicQuery(dynamicQuery, start, end);
165            }
166    
167            /**
168             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
169             *
170             * <p>
171             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PortletModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
172             * </p>
173             *
174             * @param dynamicQuery the dynamic query
175             * @param start the lower bound of the range of model instances
176             * @param end the upper bound of the range of model instances (not inclusive)
177             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
178             * @return the ordered range of matching rows
179             */
180            @Override
181            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
182                    int end, OrderByComparator<T> orderByComparator) {
183                    return portletPersistence.findWithDynamicQuery(dynamicQuery, start,
184                            end, orderByComparator);
185            }
186    
187            /**
188             * Returns the number of rows matching the dynamic query.
189             *
190             * @param dynamicQuery the dynamic query
191             * @return the number of rows matching the dynamic query
192             */
193            @Override
194            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
195                    return portletPersistence.countWithDynamicQuery(dynamicQuery);
196            }
197    
198            /**
199             * Returns the number of rows matching the dynamic query.
200             *
201             * @param dynamicQuery the dynamic query
202             * @param projection the projection to apply to the query
203             * @return the number of rows matching the dynamic query
204             */
205            @Override
206            public long dynamicQueryCount(DynamicQuery dynamicQuery,
207                    Projection projection) {
208                    return portletPersistence.countWithDynamicQuery(dynamicQuery, projection);
209            }
210    
211            @Override
212            public Portlet fetchPortlet(long id) {
213                    return portletPersistence.fetchByPrimaryKey(id);
214            }
215    
216            /**
217             * Returns the portlet with the primary key.
218             *
219             * @param id the primary key of the portlet
220             * @return the portlet
221             * @throws PortalException if a portlet with the primary key could not be found
222             */
223            @Override
224            public Portlet getPortlet(long id) throws PortalException {
225                    return portletPersistence.findByPrimaryKey(id);
226            }
227    
228            @Override
229            public ActionableDynamicQuery getActionableDynamicQuery() {
230                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
231    
232                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.PortletLocalServiceUtil.getService());
233                    actionableDynamicQuery.setClassLoader(getClassLoader());
234                    actionableDynamicQuery.setModelClass(Portlet.class);
235    
236                    actionableDynamicQuery.setPrimaryKeyPropertyName("id");
237    
238                    return actionableDynamicQuery;
239            }
240    
241            @Override
242            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
243                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
244    
245                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.PortletLocalServiceUtil.getService());
246                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
247                    indexableActionableDynamicQuery.setModelClass(Portlet.class);
248    
249                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("id");
250    
251                    return indexableActionableDynamicQuery;
252            }
253    
254            protected void initActionableDynamicQuery(
255                    ActionableDynamicQuery actionableDynamicQuery) {
256                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.PortletLocalServiceUtil.getService());
257                    actionableDynamicQuery.setClassLoader(getClassLoader());
258                    actionableDynamicQuery.setModelClass(Portlet.class);
259    
260                    actionableDynamicQuery.setPrimaryKeyPropertyName("id");
261            }
262    
263            /**
264             * @throws PortalException
265             */
266            @Override
267            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
268                    throws PortalException {
269                    return portletLocalService.deletePortlet((Portlet)persistedModel);
270            }
271    
272            @Override
273            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
274                    throws PortalException {
275                    return portletPersistence.findByPrimaryKey(primaryKeyObj);
276            }
277    
278            /**
279             * Returns a range of all the portlets.
280             *
281             * <p>
282             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PortletModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
283             * </p>
284             *
285             * @param start the lower bound of the range of portlets
286             * @param end the upper bound of the range of portlets (not inclusive)
287             * @return the range of portlets
288             */
289            @Override
290            public List<Portlet> getPortlets(int start, int end) {
291                    return portletPersistence.findAll(start, end);
292            }
293    
294            /**
295             * Returns the number of portlets.
296             *
297             * @return the number of portlets
298             */
299            @Override
300            public int getPortletsCount() {
301                    return portletPersistence.countAll();
302            }
303    
304            /**
305             * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
306             *
307             * @param portlet the portlet
308             * @return the portlet that was updated
309             */
310            @Indexable(type = IndexableType.REINDEX)
311            @Override
312            public Portlet updatePortlet(Portlet portlet) {
313                    return portletPersistence.update(portlet);
314            }
315    
316            /**
317             * Returns the portlet local service.
318             *
319             * @return the portlet local service
320             */
321            public PortletLocalService getPortletLocalService() {
322                    return portletLocalService;
323            }
324    
325            /**
326             * Sets the portlet local service.
327             *
328             * @param portletLocalService the portlet local service
329             */
330            public void setPortletLocalService(PortletLocalService portletLocalService) {
331                    this.portletLocalService = portletLocalService;
332            }
333    
334            /**
335             * Returns the portlet persistence.
336             *
337             * @return the portlet persistence
338             */
339            public PortletPersistence getPortletPersistence() {
340                    return portletPersistence;
341            }
342    
343            /**
344             * Sets the portlet persistence.
345             *
346             * @param portletPersistence the portlet persistence
347             */
348            public void setPortletPersistence(PortletPersistence portletPersistence) {
349                    this.portletPersistence = portletPersistence;
350            }
351    
352            /**
353             * Returns the counter local service.
354             *
355             * @return the counter local service
356             */
357            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
358                    return counterLocalService;
359            }
360    
361            /**
362             * Sets the counter local service.
363             *
364             * @param counterLocalService the counter local service
365             */
366            public void setCounterLocalService(
367                    com.liferay.counter.service.CounterLocalService counterLocalService) {
368                    this.counterLocalService = counterLocalService;
369            }
370    
371            /**
372             * Returns the portlet preferences local service.
373             *
374             * @return the portlet preferences local service
375             */
376            public com.liferay.portal.service.PortletPreferencesLocalService getPortletPreferencesLocalService() {
377                    return portletPreferencesLocalService;
378            }
379    
380            /**
381             * Sets the portlet preferences local service.
382             *
383             * @param portletPreferencesLocalService the portlet preferences local service
384             */
385            public void setPortletPreferencesLocalService(
386                    com.liferay.portal.service.PortletPreferencesLocalService portletPreferencesLocalService) {
387                    this.portletPreferencesLocalService = portletPreferencesLocalService;
388            }
389    
390            /**
391             * Returns the portlet preferences persistence.
392             *
393             * @return the portlet preferences persistence
394             */
395            public PortletPreferencesPersistence getPortletPreferencesPersistence() {
396                    return portletPreferencesPersistence;
397            }
398    
399            /**
400             * Sets the portlet preferences persistence.
401             *
402             * @param portletPreferencesPersistence the portlet preferences persistence
403             */
404            public void setPortletPreferencesPersistence(
405                    PortletPreferencesPersistence portletPreferencesPersistence) {
406                    this.portletPreferencesPersistence = portletPreferencesPersistence;
407            }
408    
409            /**
410             * Returns the portlet preferences finder.
411             *
412             * @return the portlet preferences finder
413             */
414            public PortletPreferencesFinder getPortletPreferencesFinder() {
415                    return portletPreferencesFinder;
416            }
417    
418            /**
419             * Sets the portlet preferences finder.
420             *
421             * @param portletPreferencesFinder the portlet preferences finder
422             */
423            public void setPortletPreferencesFinder(
424                    PortletPreferencesFinder portletPreferencesFinder) {
425                    this.portletPreferencesFinder = portletPreferencesFinder;
426            }
427    
428            /**
429             * Returns the resource local service.
430             *
431             * @return the resource local service
432             */
433            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
434                    return resourceLocalService;
435            }
436    
437            /**
438             * Sets the resource local service.
439             *
440             * @param resourceLocalService the resource local service
441             */
442            public void setResourceLocalService(
443                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
444                    this.resourceLocalService = resourceLocalService;
445            }
446    
447            /**
448             * Returns the resource action local service.
449             *
450             * @return the resource action local service
451             */
452            public com.liferay.portal.service.ResourceActionLocalService getResourceActionLocalService() {
453                    return resourceActionLocalService;
454            }
455    
456            /**
457             * Sets the resource action local service.
458             *
459             * @param resourceActionLocalService the resource action local service
460             */
461            public void setResourceActionLocalService(
462                    com.liferay.portal.service.ResourceActionLocalService resourceActionLocalService) {
463                    this.resourceActionLocalService = resourceActionLocalService;
464            }
465    
466            /**
467             * Returns the resource action persistence.
468             *
469             * @return the resource action persistence
470             */
471            public ResourceActionPersistence getResourceActionPersistence() {
472                    return resourceActionPersistence;
473            }
474    
475            /**
476             * Sets the resource action persistence.
477             *
478             * @param resourceActionPersistence the resource action persistence
479             */
480            public void setResourceActionPersistence(
481                    ResourceActionPersistence resourceActionPersistence) {
482                    this.resourceActionPersistence = resourceActionPersistence;
483            }
484    
485            /**
486             * Returns the resource block local service.
487             *
488             * @return the resource block local service
489             */
490            public com.liferay.portal.service.ResourceBlockLocalService getResourceBlockLocalService() {
491                    return resourceBlockLocalService;
492            }
493    
494            /**
495             * Sets the resource block local service.
496             *
497             * @param resourceBlockLocalService the resource block local service
498             */
499            public void setResourceBlockLocalService(
500                    com.liferay.portal.service.ResourceBlockLocalService resourceBlockLocalService) {
501                    this.resourceBlockLocalService = resourceBlockLocalService;
502            }
503    
504            /**
505             * Returns the resource block persistence.
506             *
507             * @return the resource block persistence
508             */
509            public ResourceBlockPersistence getResourceBlockPersistence() {
510                    return resourceBlockPersistence;
511            }
512    
513            /**
514             * Sets the resource block persistence.
515             *
516             * @param resourceBlockPersistence the resource block persistence
517             */
518            public void setResourceBlockPersistence(
519                    ResourceBlockPersistence resourceBlockPersistence) {
520                    this.resourceBlockPersistence = resourceBlockPersistence;
521            }
522    
523            /**
524             * Returns the resource block finder.
525             *
526             * @return the resource block finder
527             */
528            public ResourceBlockFinder getResourceBlockFinder() {
529                    return resourceBlockFinder;
530            }
531    
532            /**
533             * Sets the resource block finder.
534             *
535             * @param resourceBlockFinder the resource block finder
536             */
537            public void setResourceBlockFinder(ResourceBlockFinder resourceBlockFinder) {
538                    this.resourceBlockFinder = resourceBlockFinder;
539            }
540    
541            /**
542             * Returns the resource permission local service.
543             *
544             * @return the resource permission local service
545             */
546            public com.liferay.portal.service.ResourcePermissionLocalService getResourcePermissionLocalService() {
547                    return resourcePermissionLocalService;
548            }
549    
550            /**
551             * Sets the resource permission local service.
552             *
553             * @param resourcePermissionLocalService the resource permission local service
554             */
555            public void setResourcePermissionLocalService(
556                    com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService) {
557                    this.resourcePermissionLocalService = resourcePermissionLocalService;
558            }
559    
560            /**
561             * Returns the resource permission persistence.
562             *
563             * @return the resource permission persistence
564             */
565            public ResourcePermissionPersistence getResourcePermissionPersistence() {
566                    return resourcePermissionPersistence;
567            }
568    
569            /**
570             * Sets the resource permission persistence.
571             *
572             * @param resourcePermissionPersistence the resource permission persistence
573             */
574            public void setResourcePermissionPersistence(
575                    ResourcePermissionPersistence resourcePermissionPersistence) {
576                    this.resourcePermissionPersistence = resourcePermissionPersistence;
577            }
578    
579            /**
580             * Returns the resource permission finder.
581             *
582             * @return the resource permission finder
583             */
584            public ResourcePermissionFinder getResourcePermissionFinder() {
585                    return resourcePermissionFinder;
586            }
587    
588            /**
589             * Sets the resource permission finder.
590             *
591             * @param resourcePermissionFinder the resource permission finder
592             */
593            public void setResourcePermissionFinder(
594                    ResourcePermissionFinder resourcePermissionFinder) {
595                    this.resourcePermissionFinder = resourcePermissionFinder;
596            }
597    
598            /**
599             * Returns the role local service.
600             *
601             * @return the role local service
602             */
603            public com.liferay.portal.service.RoleLocalService getRoleLocalService() {
604                    return roleLocalService;
605            }
606    
607            /**
608             * Sets the role local service.
609             *
610             * @param roleLocalService the role local service
611             */
612            public void setRoleLocalService(
613                    com.liferay.portal.service.RoleLocalService roleLocalService) {
614                    this.roleLocalService = roleLocalService;
615            }
616    
617            /**
618             * Returns the role persistence.
619             *
620             * @return the role persistence
621             */
622            public RolePersistence getRolePersistence() {
623                    return rolePersistence;
624            }
625    
626            /**
627             * Sets the role persistence.
628             *
629             * @param rolePersistence the role persistence
630             */
631            public void setRolePersistence(RolePersistence rolePersistence) {
632                    this.rolePersistence = rolePersistence;
633            }
634    
635            /**
636             * Returns the role finder.
637             *
638             * @return the role finder
639             */
640            public RoleFinder getRoleFinder() {
641                    return roleFinder;
642            }
643    
644            /**
645             * Sets the role finder.
646             *
647             * @param roleFinder the role finder
648             */
649            public void setRoleFinder(RoleFinder roleFinder) {
650                    this.roleFinder = roleFinder;
651            }
652    
653            public void afterPropertiesSet() {
654                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Portlet",
655                            portletLocalService);
656            }
657    
658            public void destroy() {
659                    persistedModelLocalServiceRegistry.unregister(
660                            "com.liferay.portal.model.Portlet");
661            }
662    
663            /**
664             * Returns the OSGi service identifier.
665             *
666             * @return the OSGi service identifier
667             */
668            @Override
669            public String getOSGiServiceIdentifier() {
670                    return PortletLocalService.class.getName();
671            }
672    
673            protected Class<?> getModelClass() {
674                    return Portlet.class;
675            }
676    
677            protected String getModelClassName() {
678                    return Portlet.class.getName();
679            }
680    
681            /**
682             * Performs a SQL query.
683             *
684             * @param sql the sql query
685             */
686            protected void runSQL(String sql) {
687                    try {
688                            DataSource dataSource = portletPersistence.getDataSource();
689    
690                            DB db = DBManagerUtil.getDB();
691    
692                            sql = db.buildSQL(sql);
693                            sql = PortalUtil.transformSQL(sql);
694    
695                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
696                                            sql, new int[0]);
697    
698                            sqlUpdate.update();
699                    }
700                    catch (Exception e) {
701                            throw new SystemException(e);
702                    }
703            }
704    
705            @BeanReference(type = com.liferay.portal.service.PortletLocalService.class)
706            protected PortletLocalService portletLocalService;
707            @BeanReference(type = PortletPersistence.class)
708            protected PortletPersistence portletPersistence;
709            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
710            protected com.liferay.counter.service.CounterLocalService counterLocalService;
711            @BeanReference(type = com.liferay.portal.service.PortletPreferencesLocalService.class)
712            protected com.liferay.portal.service.PortletPreferencesLocalService portletPreferencesLocalService;
713            @BeanReference(type = PortletPreferencesPersistence.class)
714            protected PortletPreferencesPersistence portletPreferencesPersistence;
715            @BeanReference(type = PortletPreferencesFinder.class)
716            protected PortletPreferencesFinder portletPreferencesFinder;
717            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
718            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
719            @BeanReference(type = com.liferay.portal.service.ResourceActionLocalService.class)
720            protected com.liferay.portal.service.ResourceActionLocalService resourceActionLocalService;
721            @BeanReference(type = ResourceActionPersistence.class)
722            protected ResourceActionPersistence resourceActionPersistence;
723            @BeanReference(type = com.liferay.portal.service.ResourceBlockLocalService.class)
724            protected com.liferay.portal.service.ResourceBlockLocalService resourceBlockLocalService;
725            @BeanReference(type = ResourceBlockPersistence.class)
726            protected ResourceBlockPersistence resourceBlockPersistence;
727            @BeanReference(type = ResourceBlockFinder.class)
728            protected ResourceBlockFinder resourceBlockFinder;
729            @BeanReference(type = com.liferay.portal.service.ResourcePermissionLocalService.class)
730            protected com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService;
731            @BeanReference(type = ResourcePermissionPersistence.class)
732            protected ResourcePermissionPersistence resourcePermissionPersistence;
733            @BeanReference(type = ResourcePermissionFinder.class)
734            protected ResourcePermissionFinder resourcePermissionFinder;
735            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
736            protected com.liferay.portal.service.RoleLocalService roleLocalService;
737            @BeanReference(type = RolePersistence.class)
738            protected RolePersistence rolePersistence;
739            @BeanReference(type = RoleFinder.class)
740            protected RoleFinder roleFinder;
741            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
742            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
743    }