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