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