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.ExportActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.dao.orm.Property;
032    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
033    import com.liferay.portal.kernel.exception.PortalException;
034    import com.liferay.portal.kernel.exception.SystemException;
035    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
036    import com.liferay.portal.kernel.search.Indexable;
037    import com.liferay.portal.kernel.search.IndexableType;
038    import com.liferay.portal.kernel.util.OrderByComparator;
039    import com.liferay.portal.model.PersistedModel;
040    import com.liferay.portal.model.Role;
041    import com.liferay.portal.service.BaseLocalServiceImpl;
042    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
043    import com.liferay.portal.service.RoleLocalService;
044    import com.liferay.portal.service.persistence.ClassNamePersistence;
045    import com.liferay.portal.service.persistence.CompanyPersistence;
046    import com.liferay.portal.service.persistence.GroupFinder;
047    import com.liferay.portal.service.persistence.GroupPersistence;
048    import com.liferay.portal.service.persistence.LayoutFinder;
049    import com.liferay.portal.service.persistence.LayoutPersistence;
050    import com.liferay.portal.service.persistence.ResourceActionPersistence;
051    import com.liferay.portal.service.persistence.ResourceBlockFinder;
052    import com.liferay.portal.service.persistence.ResourceBlockPermissionPersistence;
053    import com.liferay.portal.service.persistence.ResourceBlockPersistence;
054    import com.liferay.portal.service.persistence.ResourcePermissionFinder;
055    import com.liferay.portal.service.persistence.ResourcePermissionPersistence;
056    import com.liferay.portal.service.persistence.ResourceTypePermissionFinder;
057    import com.liferay.portal.service.persistence.ResourceTypePermissionPersistence;
058    import com.liferay.portal.service.persistence.RoleFinder;
059    import com.liferay.portal.service.persistence.RolePersistence;
060    import com.liferay.portal.service.persistence.TeamFinder;
061    import com.liferay.portal.service.persistence.TeamPersistence;
062    import com.liferay.portal.service.persistence.UserFinder;
063    import com.liferay.portal.service.persistence.UserGroupGroupRoleFinder;
064    import com.liferay.portal.service.persistence.UserGroupGroupRolePersistence;
065    import com.liferay.portal.service.persistence.UserGroupRoleFinder;
066    import com.liferay.portal.service.persistence.UserGroupRolePersistence;
067    import com.liferay.portal.service.persistence.UserPersistence;
068    import com.liferay.portal.util.PortalUtil;
069    
070    import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
071    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
072    import com.liferay.portlet.exportimport.lar.ManifestSummary;
073    import com.liferay.portlet.exportimport.lar.PortletDataContext;
074    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
075    import com.liferay.portlet.exportimport.lar.StagedModelType;
076    
077    import java.io.Serializable;
078    
079    import java.util.List;
080    
081    import javax.sql.DataSource;
082    
083    /**
084     * Provides the base implementation for the role local service.
085     *
086     * <p>
087     * 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.RoleLocalServiceImpl}.
088     * </p>
089     *
090     * @author Brian Wing Shun Chan
091     * @see com.liferay.portal.service.impl.RoleLocalServiceImpl
092     * @see com.liferay.portal.service.RoleLocalServiceUtil
093     * @generated
094     */
095    @ProviderType
096    public abstract class RoleLocalServiceBaseImpl extends BaseLocalServiceImpl
097            implements RoleLocalService, IdentifiableOSGiService {
098            /*
099             * NOTE FOR DEVELOPERS:
100             *
101             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.RoleLocalServiceUtil} to access the role local service.
102             */
103    
104            /**
105             * Adds the role to the database. Also notifies the appropriate model listeners.
106             *
107             * @param role the role
108             * @return the role that was added
109             */
110            @Indexable(type = IndexableType.REINDEX)
111            @Override
112            public Role addRole(Role role) {
113                    role.setNew(true);
114    
115                    return rolePersistence.update(role);
116            }
117    
118            /**
119             * Creates a new role with the primary key. Does not add the role to the database.
120             *
121             * @param roleId the primary key for the new role
122             * @return the new role
123             */
124            @Override
125            public Role createRole(long roleId) {
126                    return rolePersistence.create(roleId);
127            }
128    
129            /**
130             * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners.
131             *
132             * @param roleId the primary key of the role
133             * @return the role that was removed
134             * @throws PortalException if a role with the primary key could not be found
135             */
136            @Indexable(type = IndexableType.DELETE)
137            @Override
138            public Role deleteRole(long roleId) throws PortalException {
139                    return rolePersistence.remove(roleId);
140            }
141    
142            /**
143             * Deletes the role from the database. Also notifies the appropriate model listeners.
144             *
145             * @param role the role
146             * @return the role that was removed
147             * @throws PortalException
148             */
149            @Indexable(type = IndexableType.DELETE)
150            @Override
151            public Role deleteRole(Role role) throws PortalException {
152                    return rolePersistence.remove(role);
153            }
154    
155            @Override
156            public DynamicQuery dynamicQuery() {
157                    Class<?> clazz = getClass();
158    
159                    return DynamicQueryFactoryUtil.forClass(Role.class,
160                            clazz.getClassLoader());
161            }
162    
163            /**
164             * Performs a dynamic query on the database and returns the matching rows.
165             *
166             * @param dynamicQuery the dynamic query
167             * @return the matching rows
168             */
169            @Override
170            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
171                    return rolePersistence.findWithDynamicQuery(dynamicQuery);
172            }
173    
174            /**
175             * Performs a dynamic query on the database and returns a range of the matching rows.
176             *
177             * <p>
178             * 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.RoleModelImpl}. 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.
179             * </p>
180             *
181             * @param dynamicQuery the dynamic query
182             * @param start the lower bound of the range of model instances
183             * @param end the upper bound of the range of model instances (not inclusive)
184             * @return the range of matching rows
185             */
186            @Override
187            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
188                    int end) {
189                    return rolePersistence.findWithDynamicQuery(dynamicQuery, start, end);
190            }
191    
192            /**
193             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
194             *
195             * <p>
196             * 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.RoleModelImpl}. 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.
197             * </p>
198             *
199             * @param dynamicQuery the dynamic query
200             * @param start the lower bound of the range of model instances
201             * @param end the upper bound of the range of model instances (not inclusive)
202             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
203             * @return the ordered range of matching rows
204             */
205            @Override
206            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
207                    int end, OrderByComparator<T> orderByComparator) {
208                    return rolePersistence.findWithDynamicQuery(dynamicQuery, start, end,
209                            orderByComparator);
210            }
211    
212            /**
213             * Returns the number of rows matching the dynamic query.
214             *
215             * @param dynamicQuery the dynamic query
216             * @return the number of rows matching the dynamic query
217             */
218            @Override
219            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
220                    return rolePersistence.countWithDynamicQuery(dynamicQuery);
221            }
222    
223            /**
224             * Returns the number of rows matching the dynamic query.
225             *
226             * @param dynamicQuery the dynamic query
227             * @param projection the projection to apply to the query
228             * @return the number of rows matching the dynamic query
229             */
230            @Override
231            public long dynamicQueryCount(DynamicQuery dynamicQuery,
232                    Projection projection) {
233                    return rolePersistence.countWithDynamicQuery(dynamicQuery, projection);
234            }
235    
236            @Override
237            public Role fetchRole(long roleId) {
238                    return rolePersistence.fetchByPrimaryKey(roleId);
239            }
240    
241            /**
242             * Returns the role with the matching UUID and company.
243             *
244             * @param uuid the role's UUID
245             * @param companyId the primary key of the company
246             * @return the matching role, or <code>null</code> if a matching role could not be found
247             */
248            @Override
249            public Role fetchRoleByUuidAndCompanyId(String uuid, long companyId) {
250                    return rolePersistence.fetchByUuid_C_First(uuid, companyId, null);
251            }
252    
253            /**
254             * Returns the role with the primary key.
255             *
256             * @param roleId the primary key of the role
257             * @return the role
258             * @throws PortalException if a role with the primary key could not be found
259             */
260            @Override
261            public Role getRole(long roleId) throws PortalException {
262                    return rolePersistence.findByPrimaryKey(roleId);
263            }
264    
265            @Override
266            public ActionableDynamicQuery getActionableDynamicQuery() {
267                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
268    
269                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.RoleLocalServiceUtil.getService());
270                    actionableDynamicQuery.setClassLoader(getClassLoader());
271                    actionableDynamicQuery.setModelClass(Role.class);
272    
273                    actionableDynamicQuery.setPrimaryKeyPropertyName("roleId");
274    
275                    return actionableDynamicQuery;
276            }
277    
278            @Override
279            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
280                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
281    
282                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.RoleLocalServiceUtil.getService());
283                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
284                    indexableActionableDynamicQuery.setModelClass(Role.class);
285    
286                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("roleId");
287    
288                    return indexableActionableDynamicQuery;
289            }
290    
291            protected void initActionableDynamicQuery(
292                    ActionableDynamicQuery actionableDynamicQuery) {
293                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.RoleLocalServiceUtil.getService());
294                    actionableDynamicQuery.setClassLoader(getClassLoader());
295                    actionableDynamicQuery.setModelClass(Role.class);
296    
297                    actionableDynamicQuery.setPrimaryKeyPropertyName("roleId");
298            }
299    
300            @Override
301            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
302                    final PortletDataContext portletDataContext) {
303                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
304                                    @Override
305                                    public long performCount() throws PortalException {
306                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
307    
308                                            StagedModelType stagedModelType = getStagedModelType();
309    
310                                            long modelAdditionCount = super.performCount();
311    
312                                            manifestSummary.addModelAdditionCount(stagedModelType,
313                                                    modelAdditionCount);
314    
315                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
316                                                            stagedModelType);
317    
318                                            manifestSummary.addModelDeletionCount(stagedModelType,
319                                                    modelDeletionCount);
320    
321                                            return modelAdditionCount;
322                                    }
323                            };
324    
325                    initActionableDynamicQuery(exportActionableDynamicQuery);
326    
327                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
328                                    @Override
329                                    public void addCriteria(DynamicQuery dynamicQuery) {
330                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
331                                                    "modifiedDate");
332    
333                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
334    
335                                            long referrerClassNameId = stagedModelType.getReferrerClassNameId();
336    
337                                            Property classNameIdProperty = PropertyFactoryUtil.forName(
338                                                            "classNameId");
339    
340                                            if ((referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ALL) &&
341                                                            (referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ANY)) {
342                                                    dynamicQuery.add(classNameIdProperty.eq(
343                                                                    stagedModelType.getReferrerClassNameId()));
344                                            }
345                                            else if (referrerClassNameId == StagedModelType.REFERRER_CLASS_NAME_ID_ANY) {
346                                                    dynamicQuery.add(classNameIdProperty.isNotNull());
347                                            }
348                                    }
349                            });
350    
351                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
352    
353                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Role>() {
354                                    @Override
355                                    public void performAction(Role role) throws PortalException {
356                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
357                                                    role);
358                                    }
359                            });
360                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
361                                    PortalUtil.getClassNameId(Role.class.getName()),
362                                    StagedModelType.REFERRER_CLASS_NAME_ID_ALL));
363    
364                    return exportActionableDynamicQuery;
365            }
366    
367            /**
368             * @throws PortalException
369             */
370            @Override
371            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
372                    throws PortalException {
373                    return roleLocalService.deleteRole((Role)persistedModel);
374            }
375    
376            @Override
377            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
378                    throws PortalException {
379                    return rolePersistence.findByPrimaryKey(primaryKeyObj);
380            }
381    
382            /**
383             * Returns the role with the matching UUID and company.
384             *
385             * @param uuid the role's UUID
386             * @param companyId the primary key of the company
387             * @return the matching role
388             * @throws PortalException if a matching role could not be found
389             */
390            @Override
391            public Role getRoleByUuidAndCompanyId(String uuid, long companyId)
392                    throws PortalException {
393                    return rolePersistence.findByUuid_C_First(uuid, companyId, null);
394            }
395    
396            /**
397             * Returns a range of all the roles.
398             *
399             * <p>
400             * 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.RoleModelImpl}. 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.
401             * </p>
402             *
403             * @param start the lower bound of the range of roles
404             * @param end the upper bound of the range of roles (not inclusive)
405             * @return the range of roles
406             */
407            @Override
408            public List<Role> getRoles(int start, int end) {
409                    return rolePersistence.findAll(start, end);
410            }
411    
412            /**
413             * Returns the number of roles.
414             *
415             * @return the number of roles
416             */
417            @Override
418            public int getRolesCount() {
419                    return rolePersistence.countAll();
420            }
421    
422            /**
423             * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
424             *
425             * @param role the role
426             * @return the role that was updated
427             */
428            @Indexable(type = IndexableType.REINDEX)
429            @Override
430            public Role updateRole(Role role) {
431                    return rolePersistence.update(role);
432            }
433    
434            /**
435             */
436            @Override
437            public void addGroupRole(long groupId, long roleId) {
438                    groupPersistence.addRole(groupId, roleId);
439            }
440    
441            /**
442             */
443            @Override
444            public void addGroupRole(long groupId, Role role) {
445                    groupPersistence.addRole(groupId, role);
446            }
447    
448            /**
449             */
450            @Override
451            public void addGroupRoles(long groupId, long[] roleIds) {
452                    groupPersistence.addRoles(groupId, roleIds);
453            }
454    
455            /**
456             */
457            @Override
458            public void addGroupRoles(long groupId, List<Role> Roles) {
459                    groupPersistence.addRoles(groupId, Roles);
460            }
461    
462            /**
463             */
464            @Override
465            public void clearGroupRoles(long groupId) {
466                    groupPersistence.clearRoles(groupId);
467            }
468    
469            /**
470             */
471            @Override
472            public void deleteGroupRole(long groupId, long roleId) {
473                    groupPersistence.removeRole(groupId, roleId);
474            }
475    
476            /**
477             */
478            @Override
479            public void deleteGroupRole(long groupId, Role role) {
480                    groupPersistence.removeRole(groupId, role);
481            }
482    
483            /**
484             */
485            @Override
486            public void deleteGroupRoles(long groupId, long[] roleIds) {
487                    groupPersistence.removeRoles(groupId, roleIds);
488            }
489    
490            /**
491             */
492            @Override
493            public void deleteGroupRoles(long groupId, List<Role> Roles) {
494                    groupPersistence.removeRoles(groupId, Roles);
495            }
496    
497            /**
498             * Returns the groupIds of the groups associated with the role.
499             *
500             * @param roleId the roleId of the role
501             * @return long[] the groupIds of groups associated with the role
502             */
503            @Override
504            public long[] getGroupPrimaryKeys(long roleId) {
505                    return rolePersistence.getGroupPrimaryKeys(roleId);
506            }
507    
508            /**
509             */
510            @Override
511            public List<Role> getGroupRoles(long groupId) {
512                    return groupPersistence.getRoles(groupId);
513            }
514    
515            /**
516             */
517            @Override
518            public List<Role> getGroupRoles(long groupId, int start, int end) {
519                    return groupPersistence.getRoles(groupId, start, end);
520            }
521    
522            /**
523             */
524            @Override
525            public List<Role> getGroupRoles(long groupId, int start, int end,
526                    OrderByComparator<Role> orderByComparator) {
527                    return groupPersistence.getRoles(groupId, start, end, orderByComparator);
528            }
529    
530            /**
531             */
532            @Override
533            public int getGroupRolesCount(long groupId) {
534                    return groupPersistence.getRolesSize(groupId);
535            }
536    
537            /**
538             */
539            @Override
540            public boolean hasGroupRole(long groupId, long roleId) {
541                    return groupPersistence.containsRole(groupId, roleId);
542            }
543    
544            /**
545             */
546            @Override
547            public boolean hasGroupRoles(long groupId) {
548                    return groupPersistence.containsRoles(groupId);
549            }
550    
551            /**
552             */
553            @Override
554            public void setGroupRoles(long groupId, long[] roleIds) {
555                    groupPersistence.setRoles(groupId, roleIds);
556            }
557    
558            /**
559             */
560            @Override
561            public void addUserRole(long userId, long roleId) {
562                    userPersistence.addRole(userId, roleId);
563            }
564    
565            /**
566             */
567            @Override
568            public void addUserRole(long userId, Role role) {
569                    userPersistence.addRole(userId, role);
570            }
571    
572            /**
573             * @throws PortalException
574             */
575            @Override
576            public void addUserRoles(long userId, long[] roleIds)
577                    throws PortalException {
578                    userPersistence.addRoles(userId, roleIds);
579            }
580    
581            /**
582             * @throws PortalException
583             */
584            @Override
585            public void addUserRoles(long userId, List<Role> Roles)
586                    throws PortalException {
587                    userPersistence.addRoles(userId, Roles);
588            }
589    
590            /**
591             */
592            @Override
593            public void clearUserRoles(long userId) {
594                    userPersistence.clearRoles(userId);
595            }
596    
597            /**
598             */
599            @Override
600            public void deleteUserRole(long userId, long roleId) {
601                    userPersistence.removeRole(userId, roleId);
602            }
603    
604            /**
605             */
606            @Override
607            public void deleteUserRole(long userId, Role role) {
608                    userPersistence.removeRole(userId, role);
609            }
610    
611            /**
612             */
613            @Override
614            public void deleteUserRoles(long userId, long[] roleIds) {
615                    userPersistence.removeRoles(userId, roleIds);
616            }
617    
618            /**
619             */
620            @Override
621            public void deleteUserRoles(long userId, List<Role> Roles) {
622                    userPersistence.removeRoles(userId, Roles);
623            }
624    
625            /**
626             * Returns the userIds of the users associated with the role.
627             *
628             * @param roleId the roleId of the role
629             * @return long[] the userIds of users associated with the role
630             */
631            @Override
632            public long[] getUserPrimaryKeys(long roleId) {
633                    return rolePersistence.getUserPrimaryKeys(roleId);
634            }
635    
636            /**
637             */
638            @Override
639            public List<Role> getUserRoles(long userId) {
640                    return userPersistence.getRoles(userId);
641            }
642    
643            /**
644             */
645            @Override
646            public List<Role> getUserRoles(long userId, int start, int end) {
647                    return userPersistence.getRoles(userId, start, end);
648            }
649    
650            /**
651             */
652            @Override
653            public List<Role> getUserRoles(long userId, int start, int end,
654                    OrderByComparator<Role> orderByComparator) {
655                    return userPersistence.getRoles(userId, start, end, orderByComparator);
656            }
657    
658            /**
659             */
660            @Override
661            public int getUserRolesCount(long userId) {
662                    return userPersistence.getRolesSize(userId);
663            }
664    
665            /**
666             */
667            @Override
668            public boolean hasUserRole(long userId, long roleId) {
669                    return userPersistence.containsRole(userId, roleId);
670            }
671    
672            /**
673             */
674            @Override
675            public boolean hasUserRoles(long userId) {
676                    return userPersistence.containsRoles(userId);
677            }
678    
679            /**
680             * @throws PortalException
681             */
682            @Override
683            public void setUserRoles(long userId, long[] roleIds)
684                    throws PortalException {
685                    userPersistence.setRoles(userId, roleIds);
686            }
687    
688            /**
689             * Returns the role local service.
690             *
691             * @return the role local service
692             */
693            public RoleLocalService getRoleLocalService() {
694                    return roleLocalService;
695            }
696    
697            /**
698             * Sets the role local service.
699             *
700             * @param roleLocalService the role local service
701             */
702            public void setRoleLocalService(RoleLocalService roleLocalService) {
703                    this.roleLocalService = roleLocalService;
704            }
705    
706            /**
707             * Returns the role persistence.
708             *
709             * @return the role persistence
710             */
711            public RolePersistence getRolePersistence() {
712                    return rolePersistence;
713            }
714    
715            /**
716             * Sets the role persistence.
717             *
718             * @param rolePersistence the role persistence
719             */
720            public void setRolePersistence(RolePersistence rolePersistence) {
721                    this.rolePersistence = rolePersistence;
722            }
723    
724            /**
725             * Returns the role finder.
726             *
727             * @return the role finder
728             */
729            public RoleFinder getRoleFinder() {
730                    return roleFinder;
731            }
732    
733            /**
734             * Sets the role finder.
735             *
736             * @param roleFinder the role finder
737             */
738            public void setRoleFinder(RoleFinder roleFinder) {
739                    this.roleFinder = roleFinder;
740            }
741    
742            /**
743             * Returns the counter local service.
744             *
745             * @return the counter local service
746             */
747            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
748                    return counterLocalService;
749            }
750    
751            /**
752             * Sets the counter local service.
753             *
754             * @param counterLocalService the counter local service
755             */
756            public void setCounterLocalService(
757                    com.liferay.counter.service.CounterLocalService counterLocalService) {
758                    this.counterLocalService = counterLocalService;
759            }
760    
761            /**
762             * Returns the class name local service.
763             *
764             * @return the class name local service
765             */
766            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
767                    return classNameLocalService;
768            }
769    
770            /**
771             * Sets the class name local service.
772             *
773             * @param classNameLocalService the class name local service
774             */
775            public void setClassNameLocalService(
776                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
777                    this.classNameLocalService = classNameLocalService;
778            }
779    
780            /**
781             * Returns the class name persistence.
782             *
783             * @return the class name persistence
784             */
785            public ClassNamePersistence getClassNamePersistence() {
786                    return classNamePersistence;
787            }
788    
789            /**
790             * Sets the class name persistence.
791             *
792             * @param classNamePersistence the class name persistence
793             */
794            public void setClassNamePersistence(
795                    ClassNamePersistence classNamePersistence) {
796                    this.classNamePersistence = classNamePersistence;
797            }
798    
799            /**
800             * Returns the company local service.
801             *
802             * @return the company local service
803             */
804            public com.liferay.portal.service.CompanyLocalService getCompanyLocalService() {
805                    return companyLocalService;
806            }
807    
808            /**
809             * Sets the company local service.
810             *
811             * @param companyLocalService the company local service
812             */
813            public void setCompanyLocalService(
814                    com.liferay.portal.service.CompanyLocalService companyLocalService) {
815                    this.companyLocalService = companyLocalService;
816            }
817    
818            /**
819             * Returns the company persistence.
820             *
821             * @return the company persistence
822             */
823            public CompanyPersistence getCompanyPersistence() {
824                    return companyPersistence;
825            }
826    
827            /**
828             * Sets the company persistence.
829             *
830             * @param companyPersistence the company persistence
831             */
832            public void setCompanyPersistence(CompanyPersistence companyPersistence) {
833                    this.companyPersistence = companyPersistence;
834            }
835    
836            /**
837             * Returns the group local service.
838             *
839             * @return the group local service
840             */
841            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
842                    return groupLocalService;
843            }
844    
845            /**
846             * Sets the group local service.
847             *
848             * @param groupLocalService the group local service
849             */
850            public void setGroupLocalService(
851                    com.liferay.portal.service.GroupLocalService groupLocalService) {
852                    this.groupLocalService = groupLocalService;
853            }
854    
855            /**
856             * Returns the group persistence.
857             *
858             * @return the group persistence
859             */
860            public GroupPersistence getGroupPersistence() {
861                    return groupPersistence;
862            }
863    
864            /**
865             * Sets the group persistence.
866             *
867             * @param groupPersistence the group persistence
868             */
869            public void setGroupPersistence(GroupPersistence groupPersistence) {
870                    this.groupPersistence = groupPersistence;
871            }
872    
873            /**
874             * Returns the group finder.
875             *
876             * @return the group finder
877             */
878            public GroupFinder getGroupFinder() {
879                    return groupFinder;
880            }
881    
882            /**
883             * Sets the group finder.
884             *
885             * @param groupFinder the group finder
886             */
887            public void setGroupFinder(GroupFinder groupFinder) {
888                    this.groupFinder = groupFinder;
889            }
890    
891            /**
892             * Returns the layout local service.
893             *
894             * @return the layout local service
895             */
896            public com.liferay.portal.service.LayoutLocalService getLayoutLocalService() {
897                    return layoutLocalService;
898            }
899    
900            /**
901             * Sets the layout local service.
902             *
903             * @param layoutLocalService the layout local service
904             */
905            public void setLayoutLocalService(
906                    com.liferay.portal.service.LayoutLocalService layoutLocalService) {
907                    this.layoutLocalService = layoutLocalService;
908            }
909    
910            /**
911             * Returns the layout persistence.
912             *
913             * @return the layout persistence
914             */
915            public LayoutPersistence getLayoutPersistence() {
916                    return layoutPersistence;
917            }
918    
919            /**
920             * Sets the layout persistence.
921             *
922             * @param layoutPersistence the layout persistence
923             */
924            public void setLayoutPersistence(LayoutPersistence layoutPersistence) {
925                    this.layoutPersistence = layoutPersistence;
926            }
927    
928            /**
929             * Returns the layout finder.
930             *
931             * @return the layout finder
932             */
933            public LayoutFinder getLayoutFinder() {
934                    return layoutFinder;
935            }
936    
937            /**
938             * Sets the layout finder.
939             *
940             * @param layoutFinder the layout finder
941             */
942            public void setLayoutFinder(LayoutFinder layoutFinder) {
943                    this.layoutFinder = layoutFinder;
944            }
945    
946            /**
947             * Returns the resource local service.
948             *
949             * @return the resource local service
950             */
951            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
952                    return resourceLocalService;
953            }
954    
955            /**
956             * Sets the resource local service.
957             *
958             * @param resourceLocalService the resource local service
959             */
960            public void setResourceLocalService(
961                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
962                    this.resourceLocalService = resourceLocalService;
963            }
964    
965            /**
966             * Returns the resource action local service.
967             *
968             * @return the resource action local service
969             */
970            public com.liferay.portal.service.ResourceActionLocalService getResourceActionLocalService() {
971                    return resourceActionLocalService;
972            }
973    
974            /**
975             * Sets the resource action local service.
976             *
977             * @param resourceActionLocalService the resource action local service
978             */
979            public void setResourceActionLocalService(
980                    com.liferay.portal.service.ResourceActionLocalService resourceActionLocalService) {
981                    this.resourceActionLocalService = resourceActionLocalService;
982            }
983    
984            /**
985             * Returns the resource action persistence.
986             *
987             * @return the resource action persistence
988             */
989            public ResourceActionPersistence getResourceActionPersistence() {
990                    return resourceActionPersistence;
991            }
992    
993            /**
994             * Sets the resource action persistence.
995             *
996             * @param resourceActionPersistence the resource action persistence
997             */
998            public void setResourceActionPersistence(
999                    ResourceActionPersistence resourceActionPersistence) {
1000                    this.resourceActionPersistence = resourceActionPersistence;
1001            }
1002    
1003            /**
1004             * Returns the resource block local service.
1005             *
1006             * @return the resource block local service
1007             */
1008            public com.liferay.portal.service.ResourceBlockLocalService getResourceBlockLocalService() {
1009                    return resourceBlockLocalService;
1010            }
1011    
1012            /**
1013             * Sets the resource block local service.
1014             *
1015             * @param resourceBlockLocalService the resource block local service
1016             */
1017            public void setResourceBlockLocalService(
1018                    com.liferay.portal.service.ResourceBlockLocalService resourceBlockLocalService) {
1019                    this.resourceBlockLocalService = resourceBlockLocalService;
1020            }
1021    
1022            /**
1023             * Returns the resource block persistence.
1024             *
1025             * @return the resource block persistence
1026             */
1027            public ResourceBlockPersistence getResourceBlockPersistence() {
1028                    return resourceBlockPersistence;
1029            }
1030    
1031            /**
1032             * Sets the resource block persistence.
1033             *
1034             * @param resourceBlockPersistence the resource block persistence
1035             */
1036            public void setResourceBlockPersistence(
1037                    ResourceBlockPersistence resourceBlockPersistence) {
1038                    this.resourceBlockPersistence = resourceBlockPersistence;
1039            }
1040    
1041            /**
1042             * Returns the resource block finder.
1043             *
1044             * @return the resource block finder
1045             */
1046            public ResourceBlockFinder getResourceBlockFinder() {
1047                    return resourceBlockFinder;
1048            }
1049    
1050            /**
1051             * Sets the resource block finder.
1052             *
1053             * @param resourceBlockFinder the resource block finder
1054             */
1055            public void setResourceBlockFinder(ResourceBlockFinder resourceBlockFinder) {
1056                    this.resourceBlockFinder = resourceBlockFinder;
1057            }
1058    
1059            /**
1060             * Returns the resource block permission local service.
1061             *
1062             * @return the resource block permission local service
1063             */
1064            public com.liferay.portal.service.ResourceBlockPermissionLocalService getResourceBlockPermissionLocalService() {
1065                    return resourceBlockPermissionLocalService;
1066            }
1067    
1068            /**
1069             * Sets the resource block permission local service.
1070             *
1071             * @param resourceBlockPermissionLocalService the resource block permission local service
1072             */
1073            public void setResourceBlockPermissionLocalService(
1074                    com.liferay.portal.service.ResourceBlockPermissionLocalService resourceBlockPermissionLocalService) {
1075                    this.resourceBlockPermissionLocalService = resourceBlockPermissionLocalService;
1076            }
1077    
1078            /**
1079             * Returns the resource block permission persistence.
1080             *
1081             * @return the resource block permission persistence
1082             */
1083            public ResourceBlockPermissionPersistence getResourceBlockPermissionPersistence() {
1084                    return resourceBlockPermissionPersistence;
1085            }
1086    
1087            /**
1088             * Sets the resource block permission persistence.
1089             *
1090             * @param resourceBlockPermissionPersistence the resource block permission persistence
1091             */
1092            public void setResourceBlockPermissionPersistence(
1093                    ResourceBlockPermissionPersistence resourceBlockPermissionPersistence) {
1094                    this.resourceBlockPermissionPersistence = resourceBlockPermissionPersistence;
1095            }
1096    
1097            /**
1098             * Returns the resource permission local service.
1099             *
1100             * @return the resource permission local service
1101             */
1102            public com.liferay.portal.service.ResourcePermissionLocalService getResourcePermissionLocalService() {
1103                    return resourcePermissionLocalService;
1104            }
1105    
1106            /**
1107             * Sets the resource permission local service.
1108             *
1109             * @param resourcePermissionLocalService the resource permission local service
1110             */
1111            public void setResourcePermissionLocalService(
1112                    com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService) {
1113                    this.resourcePermissionLocalService = resourcePermissionLocalService;
1114            }
1115    
1116            /**
1117             * Returns the resource permission persistence.
1118             *
1119             * @return the resource permission persistence
1120             */
1121            public ResourcePermissionPersistence getResourcePermissionPersistence() {
1122                    return resourcePermissionPersistence;
1123            }
1124    
1125            /**
1126             * Sets the resource permission persistence.
1127             *
1128             * @param resourcePermissionPersistence the resource permission persistence
1129             */
1130            public void setResourcePermissionPersistence(
1131                    ResourcePermissionPersistence resourcePermissionPersistence) {
1132                    this.resourcePermissionPersistence = resourcePermissionPersistence;
1133            }
1134    
1135            /**
1136             * Returns the resource permission finder.
1137             *
1138             * @return the resource permission finder
1139             */
1140            public ResourcePermissionFinder getResourcePermissionFinder() {
1141                    return resourcePermissionFinder;
1142            }
1143    
1144            /**
1145             * Sets the resource permission finder.
1146             *
1147             * @param resourcePermissionFinder the resource permission finder
1148             */
1149            public void setResourcePermissionFinder(
1150                    ResourcePermissionFinder resourcePermissionFinder) {
1151                    this.resourcePermissionFinder = resourcePermissionFinder;
1152            }
1153    
1154            /**
1155             * Returns the resource type permission local service.
1156             *
1157             * @return the resource type permission local service
1158             */
1159            public com.liferay.portal.service.ResourceTypePermissionLocalService getResourceTypePermissionLocalService() {
1160                    return resourceTypePermissionLocalService;
1161            }
1162    
1163            /**
1164             * Sets the resource type permission local service.
1165             *
1166             * @param resourceTypePermissionLocalService the resource type permission local service
1167             */
1168            public void setResourceTypePermissionLocalService(
1169                    com.liferay.portal.service.ResourceTypePermissionLocalService resourceTypePermissionLocalService) {
1170                    this.resourceTypePermissionLocalService = resourceTypePermissionLocalService;
1171            }
1172    
1173            /**
1174             * Returns the resource type permission persistence.
1175             *
1176             * @return the resource type permission persistence
1177             */
1178            public ResourceTypePermissionPersistence getResourceTypePermissionPersistence() {
1179                    return resourceTypePermissionPersistence;
1180            }
1181    
1182            /**
1183             * Sets the resource type permission persistence.
1184             *
1185             * @param resourceTypePermissionPersistence the resource type permission persistence
1186             */
1187            public void setResourceTypePermissionPersistence(
1188                    ResourceTypePermissionPersistence resourceTypePermissionPersistence) {
1189                    this.resourceTypePermissionPersistence = resourceTypePermissionPersistence;
1190            }
1191    
1192            /**
1193             * Returns the resource type permission finder.
1194             *
1195             * @return the resource type permission finder
1196             */
1197            public ResourceTypePermissionFinder getResourceTypePermissionFinder() {
1198                    return resourceTypePermissionFinder;
1199            }
1200    
1201            /**
1202             * Sets the resource type permission finder.
1203             *
1204             * @param resourceTypePermissionFinder the resource type permission finder
1205             */
1206            public void setResourceTypePermissionFinder(
1207                    ResourceTypePermissionFinder resourceTypePermissionFinder) {
1208                    this.resourceTypePermissionFinder = resourceTypePermissionFinder;
1209            }
1210    
1211            /**
1212             * Returns the expando row local service.
1213             *
1214             * @return the expando row local service
1215             */
1216            public com.liferay.portlet.expando.service.ExpandoRowLocalService getExpandoRowLocalService() {
1217                    return expandoRowLocalService;
1218            }
1219    
1220            /**
1221             * Sets the expando row local service.
1222             *
1223             * @param expandoRowLocalService the expando row local service
1224             */
1225            public void setExpandoRowLocalService(
1226                    com.liferay.portlet.expando.service.ExpandoRowLocalService expandoRowLocalService) {
1227                    this.expandoRowLocalService = expandoRowLocalService;
1228            }
1229    
1230            /**
1231             * Returns the expando row persistence.
1232             *
1233             * @return the expando row persistence
1234             */
1235            public ExpandoRowPersistence getExpandoRowPersistence() {
1236                    return expandoRowPersistence;
1237            }
1238    
1239            /**
1240             * Sets the expando row persistence.
1241             *
1242             * @param expandoRowPersistence the expando row persistence
1243             */
1244            public void setExpandoRowPersistence(
1245                    ExpandoRowPersistence expandoRowPersistence) {
1246                    this.expandoRowPersistence = expandoRowPersistence;
1247            }
1248    
1249            /**
1250             * Returns the team local service.
1251             *
1252             * @return the team local service
1253             */
1254            public com.liferay.portal.service.TeamLocalService getTeamLocalService() {
1255                    return teamLocalService;
1256            }
1257    
1258            /**
1259             * Sets the team local service.
1260             *
1261             * @param teamLocalService the team local service
1262             */
1263            public void setTeamLocalService(
1264                    com.liferay.portal.service.TeamLocalService teamLocalService) {
1265                    this.teamLocalService = teamLocalService;
1266            }
1267    
1268            /**
1269             * Returns the team persistence.
1270             *
1271             * @return the team persistence
1272             */
1273            public TeamPersistence getTeamPersistence() {
1274                    return teamPersistence;
1275            }
1276    
1277            /**
1278             * Sets the team persistence.
1279             *
1280             * @param teamPersistence the team persistence
1281             */
1282            public void setTeamPersistence(TeamPersistence teamPersistence) {
1283                    this.teamPersistence = teamPersistence;
1284            }
1285    
1286            /**
1287             * Returns the team finder.
1288             *
1289             * @return the team finder
1290             */
1291            public TeamFinder getTeamFinder() {
1292                    return teamFinder;
1293            }
1294    
1295            /**
1296             * Sets the team finder.
1297             *
1298             * @param teamFinder the team finder
1299             */
1300            public void setTeamFinder(TeamFinder teamFinder) {
1301                    this.teamFinder = teamFinder;
1302            }
1303    
1304            /**
1305             * Returns the user local service.
1306             *
1307             * @return the user local service
1308             */
1309            public com.liferay.portal.service.UserLocalService getUserLocalService() {
1310                    return userLocalService;
1311            }
1312    
1313            /**
1314             * Sets the user local service.
1315             *
1316             * @param userLocalService the user local service
1317             */
1318            public void setUserLocalService(
1319                    com.liferay.portal.service.UserLocalService userLocalService) {
1320                    this.userLocalService = userLocalService;
1321            }
1322    
1323            /**
1324             * Returns the user persistence.
1325             *
1326             * @return the user persistence
1327             */
1328            public UserPersistence getUserPersistence() {
1329                    return userPersistence;
1330            }
1331    
1332            /**
1333             * Sets the user persistence.
1334             *
1335             * @param userPersistence the user persistence
1336             */
1337            public void setUserPersistence(UserPersistence userPersistence) {
1338                    this.userPersistence = userPersistence;
1339            }
1340    
1341            /**
1342             * Returns the user finder.
1343             *
1344             * @return the user finder
1345             */
1346            public UserFinder getUserFinder() {
1347                    return userFinder;
1348            }
1349    
1350            /**
1351             * Sets the user finder.
1352             *
1353             * @param userFinder the user finder
1354             */
1355            public void setUserFinder(UserFinder userFinder) {
1356                    this.userFinder = userFinder;
1357            }
1358    
1359            /**
1360             * Returns the user group group role local service.
1361             *
1362             * @return the user group group role local service
1363             */
1364            public com.liferay.portal.service.UserGroupGroupRoleLocalService getUserGroupGroupRoleLocalService() {
1365                    return userGroupGroupRoleLocalService;
1366            }
1367    
1368            /**
1369             * Sets the user group group role local service.
1370             *
1371             * @param userGroupGroupRoleLocalService the user group group role local service
1372             */
1373            public void setUserGroupGroupRoleLocalService(
1374                    com.liferay.portal.service.UserGroupGroupRoleLocalService userGroupGroupRoleLocalService) {
1375                    this.userGroupGroupRoleLocalService = userGroupGroupRoleLocalService;
1376            }
1377    
1378            /**
1379             * Returns the user group group role persistence.
1380             *
1381             * @return the user group group role persistence
1382             */
1383            public UserGroupGroupRolePersistence getUserGroupGroupRolePersistence() {
1384                    return userGroupGroupRolePersistence;
1385            }
1386    
1387            /**
1388             * Sets the user group group role persistence.
1389             *
1390             * @param userGroupGroupRolePersistence the user group group role persistence
1391             */
1392            public void setUserGroupGroupRolePersistence(
1393                    UserGroupGroupRolePersistence userGroupGroupRolePersistence) {
1394                    this.userGroupGroupRolePersistence = userGroupGroupRolePersistence;
1395            }
1396    
1397            /**
1398             * Returns the user group group role finder.
1399             *
1400             * @return the user group group role finder
1401             */
1402            public UserGroupGroupRoleFinder getUserGroupGroupRoleFinder() {
1403                    return userGroupGroupRoleFinder;
1404            }
1405    
1406            /**
1407             * Sets the user group group role finder.
1408             *
1409             * @param userGroupGroupRoleFinder the user group group role finder
1410             */
1411            public void setUserGroupGroupRoleFinder(
1412                    UserGroupGroupRoleFinder userGroupGroupRoleFinder) {
1413                    this.userGroupGroupRoleFinder = userGroupGroupRoleFinder;
1414            }
1415    
1416            /**
1417             * Returns the user group role local service.
1418             *
1419             * @return the user group role local service
1420             */
1421            public com.liferay.portal.service.UserGroupRoleLocalService getUserGroupRoleLocalService() {
1422                    return userGroupRoleLocalService;
1423            }
1424    
1425            /**
1426             * Sets the user group role local service.
1427             *
1428             * @param userGroupRoleLocalService the user group role local service
1429             */
1430            public void setUserGroupRoleLocalService(
1431                    com.liferay.portal.service.UserGroupRoleLocalService userGroupRoleLocalService) {
1432                    this.userGroupRoleLocalService = userGroupRoleLocalService;
1433            }
1434    
1435            /**
1436             * Returns the user group role persistence.
1437             *
1438             * @return the user group role persistence
1439             */
1440            public UserGroupRolePersistence getUserGroupRolePersistence() {
1441                    return userGroupRolePersistence;
1442            }
1443    
1444            /**
1445             * Sets the user group role persistence.
1446             *
1447             * @param userGroupRolePersistence the user group role persistence
1448             */
1449            public void setUserGroupRolePersistence(
1450                    UserGroupRolePersistence userGroupRolePersistence) {
1451                    this.userGroupRolePersistence = userGroupRolePersistence;
1452            }
1453    
1454            /**
1455             * Returns the user group role finder.
1456             *
1457             * @return the user group role finder
1458             */
1459            public UserGroupRoleFinder getUserGroupRoleFinder() {
1460                    return userGroupRoleFinder;
1461            }
1462    
1463            /**
1464             * Sets the user group role finder.
1465             *
1466             * @param userGroupRoleFinder the user group role finder
1467             */
1468            public void setUserGroupRoleFinder(UserGroupRoleFinder userGroupRoleFinder) {
1469                    this.userGroupRoleFinder = userGroupRoleFinder;
1470            }
1471    
1472            public void afterPropertiesSet() {
1473                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Role",
1474                            roleLocalService);
1475            }
1476    
1477            public void destroy() {
1478                    persistedModelLocalServiceRegistry.unregister(
1479                            "com.liferay.portal.model.Role");
1480            }
1481    
1482            /**
1483             * Returns the OSGi service identifier.
1484             *
1485             * @return the OSGi service identifier
1486             */
1487            @Override
1488            public String getOSGiServiceIdentifier() {
1489                    return RoleLocalService.class.getName();
1490            }
1491    
1492            protected Class<?> getModelClass() {
1493                    return Role.class;
1494            }
1495    
1496            protected String getModelClassName() {
1497                    return Role.class.getName();
1498            }
1499    
1500            /**
1501             * Performs a SQL query.
1502             *
1503             * @param sql the sql query
1504             */
1505            protected void runSQL(String sql) {
1506                    try {
1507                            DataSource dataSource = rolePersistence.getDataSource();
1508    
1509                            DB db = DBManagerUtil.getDB();
1510    
1511                            sql = db.buildSQL(sql);
1512                            sql = PortalUtil.transformSQL(sql);
1513    
1514                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1515                                            sql, new int[0]);
1516    
1517                            sqlUpdate.update();
1518                    }
1519                    catch (Exception e) {
1520                            throw new SystemException(e);
1521                    }
1522            }
1523    
1524            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
1525            protected RoleLocalService roleLocalService;
1526            @BeanReference(type = RolePersistence.class)
1527            protected RolePersistence rolePersistence;
1528            @BeanReference(type = RoleFinder.class)
1529            protected RoleFinder roleFinder;
1530            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1531            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1532            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
1533            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
1534            @BeanReference(type = ClassNamePersistence.class)
1535            protected ClassNamePersistence classNamePersistence;
1536            @BeanReference(type = com.liferay.portal.service.CompanyLocalService.class)
1537            protected com.liferay.portal.service.CompanyLocalService companyLocalService;
1538            @BeanReference(type = CompanyPersistence.class)
1539            protected CompanyPersistence companyPersistence;
1540            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
1541            protected com.liferay.portal.service.GroupLocalService groupLocalService;
1542            @BeanReference(type = GroupPersistence.class)
1543            protected GroupPersistence groupPersistence;
1544            @BeanReference(type = GroupFinder.class)
1545            protected GroupFinder groupFinder;
1546            @BeanReference(type = com.liferay.portal.service.LayoutLocalService.class)
1547            protected com.liferay.portal.service.LayoutLocalService layoutLocalService;
1548            @BeanReference(type = LayoutPersistence.class)
1549            protected LayoutPersistence layoutPersistence;
1550            @BeanReference(type = LayoutFinder.class)
1551            protected LayoutFinder layoutFinder;
1552            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1553            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1554            @BeanReference(type = com.liferay.portal.service.ResourceActionLocalService.class)
1555            protected com.liferay.portal.service.ResourceActionLocalService resourceActionLocalService;
1556            @BeanReference(type = ResourceActionPersistence.class)
1557            protected ResourceActionPersistence resourceActionPersistence;
1558            @BeanReference(type = com.liferay.portal.service.ResourceBlockLocalService.class)
1559            protected com.liferay.portal.service.ResourceBlockLocalService resourceBlockLocalService;
1560            @BeanReference(type = ResourceBlockPersistence.class)
1561            protected ResourceBlockPersistence resourceBlockPersistence;
1562            @BeanReference(type = ResourceBlockFinder.class)
1563            protected ResourceBlockFinder resourceBlockFinder;
1564            @BeanReference(type = com.liferay.portal.service.ResourceBlockPermissionLocalService.class)
1565            protected com.liferay.portal.service.ResourceBlockPermissionLocalService resourceBlockPermissionLocalService;
1566            @BeanReference(type = ResourceBlockPermissionPersistence.class)
1567            protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
1568            @BeanReference(type = com.liferay.portal.service.ResourcePermissionLocalService.class)
1569            protected com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService;
1570            @BeanReference(type = ResourcePermissionPersistence.class)
1571            protected ResourcePermissionPersistence resourcePermissionPersistence;
1572            @BeanReference(type = ResourcePermissionFinder.class)
1573            protected ResourcePermissionFinder resourcePermissionFinder;
1574            @BeanReference(type = com.liferay.portal.service.ResourceTypePermissionLocalService.class)
1575            protected com.liferay.portal.service.ResourceTypePermissionLocalService resourceTypePermissionLocalService;
1576            @BeanReference(type = ResourceTypePermissionPersistence.class)
1577            protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
1578            @BeanReference(type = ResourceTypePermissionFinder.class)
1579            protected ResourceTypePermissionFinder resourceTypePermissionFinder;
1580            @BeanReference(type = com.liferay.portlet.expando.service.ExpandoRowLocalService.class)
1581            protected com.liferay.portlet.expando.service.ExpandoRowLocalService expandoRowLocalService;
1582            @BeanReference(type = ExpandoRowPersistence.class)
1583            protected ExpandoRowPersistence expandoRowPersistence;
1584            @BeanReference(type = com.liferay.portal.service.TeamLocalService.class)
1585            protected com.liferay.portal.service.TeamLocalService teamLocalService;
1586            @BeanReference(type = TeamPersistence.class)
1587            protected TeamPersistence teamPersistence;
1588            @BeanReference(type = TeamFinder.class)
1589            protected TeamFinder teamFinder;
1590            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1591            protected com.liferay.portal.service.UserLocalService userLocalService;
1592            @BeanReference(type = UserPersistence.class)
1593            protected UserPersistence userPersistence;
1594            @BeanReference(type = UserFinder.class)
1595            protected UserFinder userFinder;
1596            @BeanReference(type = com.liferay.portal.service.UserGroupGroupRoleLocalService.class)
1597            protected com.liferay.portal.service.UserGroupGroupRoleLocalService userGroupGroupRoleLocalService;
1598            @BeanReference(type = UserGroupGroupRolePersistence.class)
1599            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1600            @BeanReference(type = UserGroupGroupRoleFinder.class)
1601            protected UserGroupGroupRoleFinder userGroupGroupRoleFinder;
1602            @BeanReference(type = com.liferay.portal.service.UserGroupRoleLocalService.class)
1603            protected com.liferay.portal.service.UserGroupRoleLocalService userGroupRoleLocalService;
1604            @BeanReference(type = UserGroupRolePersistence.class)
1605            protected UserGroupRolePersistence userGroupRolePersistence;
1606            @BeanReference(type = UserGroupRoleFinder.class)
1607            protected UserGroupRoleFinder userGroupRoleFinder;
1608            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1609            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1610    }