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(roleLocalService);
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(roleLocalService);
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(roleLocalService);
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             * @throws PortalException
561             */
562            @Override
563            public void addUserRole(long userId, long roleId) throws PortalException {
564                    userPersistence.addRole(userId, roleId);
565            }
566    
567            /**
568             * @throws PortalException
569             */
570            @Override
571            public void addUserRole(long userId, Role role) throws PortalException {
572                    userPersistence.addRole(userId, role);
573            }
574    
575            /**
576             * @throws PortalException
577             */
578            @Override
579            public void addUserRoles(long userId, long[] roleIds)
580                    throws PortalException {
581                    userPersistence.addRoles(userId, roleIds);
582            }
583    
584            /**
585             * @throws PortalException
586             */
587            @Override
588            public void addUserRoles(long userId, List<Role> roles)
589                    throws PortalException {
590                    userPersistence.addRoles(userId, roles);
591            }
592    
593            /**
594             * @throws PortalException
595             */
596            @Override
597            public void clearUserRoles(long userId) throws PortalException {
598                    userPersistence.clearRoles(userId);
599            }
600    
601            /**
602             * @throws PortalException
603             */
604            @Override
605            public void deleteUserRole(long userId, long roleId)
606                    throws PortalException {
607                    userPersistence.removeRole(userId, roleId);
608            }
609    
610            /**
611             * @throws PortalException
612             */
613            @Override
614            public void deleteUserRole(long userId, Role role)
615                    throws PortalException {
616                    userPersistence.removeRole(userId, role);
617            }
618    
619            /**
620             * @throws PortalException
621             */
622            @Override
623            public void deleteUserRoles(long userId, long[] roleIds)
624                    throws PortalException {
625                    userPersistence.removeRoles(userId, roleIds);
626            }
627    
628            /**
629             * @throws PortalException
630             */
631            @Override
632            public void deleteUserRoles(long userId, List<Role> roles)
633                    throws PortalException {
634                    userPersistence.removeRoles(userId, roles);
635            }
636    
637            /**
638             * Returns the userIds of the users associated with the role.
639             *
640             * @param roleId the roleId of the role
641             * @return long[] the userIds of users associated with the role
642             */
643            @Override
644            public long[] getUserPrimaryKeys(long roleId) {
645                    return rolePersistence.getUserPrimaryKeys(roleId);
646            }
647    
648            /**
649             */
650            @Override
651            public List<Role> getUserRoles(long userId) {
652                    return userPersistence.getRoles(userId);
653            }
654    
655            /**
656             */
657            @Override
658            public List<Role> getUserRoles(long userId, int start, int end) {
659                    return userPersistence.getRoles(userId, start, end);
660            }
661    
662            /**
663             */
664            @Override
665            public List<Role> getUserRoles(long userId, int start, int end,
666                    OrderByComparator<Role> orderByComparator) {
667                    return userPersistence.getRoles(userId, start, end, orderByComparator);
668            }
669    
670            /**
671             */
672            @Override
673            public int getUserRolesCount(long userId) {
674                    return userPersistence.getRolesSize(userId);
675            }
676    
677            /**
678             */
679            @Override
680            public boolean hasUserRole(long userId, long roleId) {
681                    return userPersistence.containsRole(userId, roleId);
682            }
683    
684            /**
685             */
686            @Override
687            public boolean hasUserRoles(long userId) {
688                    return userPersistence.containsRoles(userId);
689            }
690    
691            /**
692             * @throws PortalException
693             */
694            @Override
695            public void setUserRoles(long userId, long[] roleIds)
696                    throws PortalException {
697                    userPersistence.setRoles(userId, roleIds);
698            }
699    
700            /**
701             * Returns the role local service.
702             *
703             * @return the role local service
704             */
705            public RoleLocalService getRoleLocalService() {
706                    return roleLocalService;
707            }
708    
709            /**
710             * Sets the role local service.
711             *
712             * @param roleLocalService the role local service
713             */
714            public void setRoleLocalService(RoleLocalService roleLocalService) {
715                    this.roleLocalService = roleLocalService;
716            }
717    
718            /**
719             * Returns the role persistence.
720             *
721             * @return the role persistence
722             */
723            public RolePersistence getRolePersistence() {
724                    return rolePersistence;
725            }
726    
727            /**
728             * Sets the role persistence.
729             *
730             * @param rolePersistence the role persistence
731             */
732            public void setRolePersistence(RolePersistence rolePersistence) {
733                    this.rolePersistence = rolePersistence;
734            }
735    
736            /**
737             * Returns the role finder.
738             *
739             * @return the role finder
740             */
741            public RoleFinder getRoleFinder() {
742                    return roleFinder;
743            }
744    
745            /**
746             * Sets the role finder.
747             *
748             * @param roleFinder the role finder
749             */
750            public void setRoleFinder(RoleFinder roleFinder) {
751                    this.roleFinder = roleFinder;
752            }
753    
754            /**
755             * Returns the counter local service.
756             *
757             * @return the counter local service
758             */
759            public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
760                    return counterLocalService;
761            }
762    
763            /**
764             * Sets the counter local service.
765             *
766             * @param counterLocalService the counter local service
767             */
768            public void setCounterLocalService(
769                    com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
770                    this.counterLocalService = counterLocalService;
771            }
772    
773            /**
774             * Returns the class name local service.
775             *
776             * @return the class name local service
777             */
778            public com.liferay.portal.kernel.service.ClassNameLocalService getClassNameLocalService() {
779                    return classNameLocalService;
780            }
781    
782            /**
783             * Sets the class name local service.
784             *
785             * @param classNameLocalService the class name local service
786             */
787            public void setClassNameLocalService(
788                    com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService) {
789                    this.classNameLocalService = classNameLocalService;
790            }
791    
792            /**
793             * Returns the class name persistence.
794             *
795             * @return the class name persistence
796             */
797            public ClassNamePersistence getClassNamePersistence() {
798                    return classNamePersistence;
799            }
800    
801            /**
802             * Sets the class name persistence.
803             *
804             * @param classNamePersistence the class name persistence
805             */
806            public void setClassNamePersistence(
807                    ClassNamePersistence classNamePersistence) {
808                    this.classNamePersistence = classNamePersistence;
809            }
810    
811            /**
812             * Returns the company local service.
813             *
814             * @return the company local service
815             */
816            public com.liferay.portal.kernel.service.CompanyLocalService getCompanyLocalService() {
817                    return companyLocalService;
818            }
819    
820            /**
821             * Sets the company local service.
822             *
823             * @param companyLocalService the company local service
824             */
825            public void setCompanyLocalService(
826                    com.liferay.portal.kernel.service.CompanyLocalService companyLocalService) {
827                    this.companyLocalService = companyLocalService;
828            }
829    
830            /**
831             * Returns the company persistence.
832             *
833             * @return the company persistence
834             */
835            public CompanyPersistence getCompanyPersistence() {
836                    return companyPersistence;
837            }
838    
839            /**
840             * Sets the company persistence.
841             *
842             * @param companyPersistence the company persistence
843             */
844            public void setCompanyPersistence(CompanyPersistence companyPersistence) {
845                    this.companyPersistence = companyPersistence;
846            }
847    
848            /**
849             * Returns the group local service.
850             *
851             * @return the group local service
852             */
853            public com.liferay.portal.kernel.service.GroupLocalService getGroupLocalService() {
854                    return groupLocalService;
855            }
856    
857            /**
858             * Sets the group local service.
859             *
860             * @param groupLocalService the group local service
861             */
862            public void setGroupLocalService(
863                    com.liferay.portal.kernel.service.GroupLocalService groupLocalService) {
864                    this.groupLocalService = groupLocalService;
865            }
866    
867            /**
868             * Returns the group persistence.
869             *
870             * @return the group persistence
871             */
872            public GroupPersistence getGroupPersistence() {
873                    return groupPersistence;
874            }
875    
876            /**
877             * Sets the group persistence.
878             *
879             * @param groupPersistence the group persistence
880             */
881            public void setGroupPersistence(GroupPersistence groupPersistence) {
882                    this.groupPersistence = groupPersistence;
883            }
884    
885            /**
886             * Returns the group finder.
887             *
888             * @return the group finder
889             */
890            public GroupFinder getGroupFinder() {
891                    return groupFinder;
892            }
893    
894            /**
895             * Sets the group finder.
896             *
897             * @param groupFinder the group finder
898             */
899            public void setGroupFinder(GroupFinder groupFinder) {
900                    this.groupFinder = groupFinder;
901            }
902    
903            /**
904             * Returns the layout local service.
905             *
906             * @return the layout local service
907             */
908            public com.liferay.portal.kernel.service.LayoutLocalService getLayoutLocalService() {
909                    return layoutLocalService;
910            }
911    
912            /**
913             * Sets the layout local service.
914             *
915             * @param layoutLocalService the layout local service
916             */
917            public void setLayoutLocalService(
918                    com.liferay.portal.kernel.service.LayoutLocalService layoutLocalService) {
919                    this.layoutLocalService = layoutLocalService;
920            }
921    
922            /**
923             * Returns the layout persistence.
924             *
925             * @return the layout persistence
926             */
927            public LayoutPersistence getLayoutPersistence() {
928                    return layoutPersistence;
929            }
930    
931            /**
932             * Sets the layout persistence.
933             *
934             * @param layoutPersistence the layout persistence
935             */
936            public void setLayoutPersistence(LayoutPersistence layoutPersistence) {
937                    this.layoutPersistence = layoutPersistence;
938            }
939    
940            /**
941             * Returns the layout finder.
942             *
943             * @return the layout finder
944             */
945            public LayoutFinder getLayoutFinder() {
946                    return layoutFinder;
947            }
948    
949            /**
950             * Sets the layout finder.
951             *
952             * @param layoutFinder the layout finder
953             */
954            public void setLayoutFinder(LayoutFinder layoutFinder) {
955                    this.layoutFinder = layoutFinder;
956            }
957    
958            /**
959             * Returns the resource local service.
960             *
961             * @return the resource local service
962             */
963            public com.liferay.portal.kernel.service.ResourceLocalService getResourceLocalService() {
964                    return resourceLocalService;
965            }
966    
967            /**
968             * Sets the resource local service.
969             *
970             * @param resourceLocalService the resource local service
971             */
972            public void setResourceLocalService(
973                    com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
974                    this.resourceLocalService = resourceLocalService;
975            }
976    
977            /**
978             * Returns the resource action local service.
979             *
980             * @return the resource action local service
981             */
982            public com.liferay.portal.kernel.service.ResourceActionLocalService getResourceActionLocalService() {
983                    return resourceActionLocalService;
984            }
985    
986            /**
987             * Sets the resource action local service.
988             *
989             * @param resourceActionLocalService the resource action local service
990             */
991            public void setResourceActionLocalService(
992                    com.liferay.portal.kernel.service.ResourceActionLocalService resourceActionLocalService) {
993                    this.resourceActionLocalService = resourceActionLocalService;
994            }
995    
996            /**
997             * Returns the resource action persistence.
998             *
999             * @return the resource action persistence
1000             */
1001            public ResourceActionPersistence getResourceActionPersistence() {
1002                    return resourceActionPersistence;
1003            }
1004    
1005            /**
1006             * Sets the resource action persistence.
1007             *
1008             * @param resourceActionPersistence the resource action persistence
1009             */
1010            public void setResourceActionPersistence(
1011                    ResourceActionPersistence resourceActionPersistence) {
1012                    this.resourceActionPersistence = resourceActionPersistence;
1013            }
1014    
1015            /**
1016             * Returns the resource block local service.
1017             *
1018             * @return the resource block local service
1019             */
1020            public com.liferay.portal.kernel.service.ResourceBlockLocalService getResourceBlockLocalService() {
1021                    return resourceBlockLocalService;
1022            }
1023    
1024            /**
1025             * Sets the resource block local service.
1026             *
1027             * @param resourceBlockLocalService the resource block local service
1028             */
1029            public void setResourceBlockLocalService(
1030                    com.liferay.portal.kernel.service.ResourceBlockLocalService resourceBlockLocalService) {
1031                    this.resourceBlockLocalService = resourceBlockLocalService;
1032            }
1033    
1034            /**
1035             * Returns the resource block persistence.
1036             *
1037             * @return the resource block persistence
1038             */
1039            public ResourceBlockPersistence getResourceBlockPersistence() {
1040                    return resourceBlockPersistence;
1041            }
1042    
1043            /**
1044             * Sets the resource block persistence.
1045             *
1046             * @param resourceBlockPersistence the resource block persistence
1047             */
1048            public void setResourceBlockPersistence(
1049                    ResourceBlockPersistence resourceBlockPersistence) {
1050                    this.resourceBlockPersistence = resourceBlockPersistence;
1051            }
1052    
1053            /**
1054             * Returns the resource block finder.
1055             *
1056             * @return the resource block finder
1057             */
1058            public ResourceBlockFinder getResourceBlockFinder() {
1059                    return resourceBlockFinder;
1060            }
1061    
1062            /**
1063             * Sets the resource block finder.
1064             *
1065             * @param resourceBlockFinder the resource block finder
1066             */
1067            public void setResourceBlockFinder(ResourceBlockFinder resourceBlockFinder) {
1068                    this.resourceBlockFinder = resourceBlockFinder;
1069            }
1070    
1071            /**
1072             * Returns the resource block permission local service.
1073             *
1074             * @return the resource block permission local service
1075             */
1076            public com.liferay.portal.kernel.service.ResourceBlockPermissionLocalService getResourceBlockPermissionLocalService() {
1077                    return resourceBlockPermissionLocalService;
1078            }
1079    
1080            /**
1081             * Sets the resource block permission local service.
1082             *
1083             * @param resourceBlockPermissionLocalService the resource block permission local service
1084             */
1085            public void setResourceBlockPermissionLocalService(
1086                    com.liferay.portal.kernel.service.ResourceBlockPermissionLocalService resourceBlockPermissionLocalService) {
1087                    this.resourceBlockPermissionLocalService = resourceBlockPermissionLocalService;
1088            }
1089    
1090            /**
1091             * Returns the resource block permission persistence.
1092             *
1093             * @return the resource block permission persistence
1094             */
1095            public ResourceBlockPermissionPersistence getResourceBlockPermissionPersistence() {
1096                    return resourceBlockPermissionPersistence;
1097            }
1098    
1099            /**
1100             * Sets the resource block permission persistence.
1101             *
1102             * @param resourceBlockPermissionPersistence the resource block permission persistence
1103             */
1104            public void setResourceBlockPermissionPersistence(
1105                    ResourceBlockPermissionPersistence resourceBlockPermissionPersistence) {
1106                    this.resourceBlockPermissionPersistence = resourceBlockPermissionPersistence;
1107            }
1108    
1109            /**
1110             * Returns the resource permission local service.
1111             *
1112             * @return the resource permission local service
1113             */
1114            public com.liferay.portal.kernel.service.ResourcePermissionLocalService getResourcePermissionLocalService() {
1115                    return resourcePermissionLocalService;
1116            }
1117    
1118            /**
1119             * Sets the resource permission local service.
1120             *
1121             * @param resourcePermissionLocalService the resource permission local service
1122             */
1123            public void setResourcePermissionLocalService(
1124                    com.liferay.portal.kernel.service.ResourcePermissionLocalService resourcePermissionLocalService) {
1125                    this.resourcePermissionLocalService = resourcePermissionLocalService;
1126            }
1127    
1128            /**
1129             * Returns the resource permission persistence.
1130             *
1131             * @return the resource permission persistence
1132             */
1133            public ResourcePermissionPersistence getResourcePermissionPersistence() {
1134                    return resourcePermissionPersistence;
1135            }
1136    
1137            /**
1138             * Sets the resource permission persistence.
1139             *
1140             * @param resourcePermissionPersistence the resource permission persistence
1141             */
1142            public void setResourcePermissionPersistence(
1143                    ResourcePermissionPersistence resourcePermissionPersistence) {
1144                    this.resourcePermissionPersistence = resourcePermissionPersistence;
1145            }
1146    
1147            /**
1148             * Returns the resource permission finder.
1149             *
1150             * @return the resource permission finder
1151             */
1152            public ResourcePermissionFinder getResourcePermissionFinder() {
1153                    return resourcePermissionFinder;
1154            }
1155    
1156            /**
1157             * Sets the resource permission finder.
1158             *
1159             * @param resourcePermissionFinder the resource permission finder
1160             */
1161            public void setResourcePermissionFinder(
1162                    ResourcePermissionFinder resourcePermissionFinder) {
1163                    this.resourcePermissionFinder = resourcePermissionFinder;
1164            }
1165    
1166            /**
1167             * Returns the resource type permission local service.
1168             *
1169             * @return the resource type permission local service
1170             */
1171            public com.liferay.portal.kernel.service.ResourceTypePermissionLocalService getResourceTypePermissionLocalService() {
1172                    return resourceTypePermissionLocalService;
1173            }
1174    
1175            /**
1176             * Sets the resource type permission local service.
1177             *
1178             * @param resourceTypePermissionLocalService the resource type permission local service
1179             */
1180            public void setResourceTypePermissionLocalService(
1181                    com.liferay.portal.kernel.service.ResourceTypePermissionLocalService resourceTypePermissionLocalService) {
1182                    this.resourceTypePermissionLocalService = resourceTypePermissionLocalService;
1183            }
1184    
1185            /**
1186             * Returns the resource type permission persistence.
1187             *
1188             * @return the resource type permission persistence
1189             */
1190            public ResourceTypePermissionPersistence getResourceTypePermissionPersistence() {
1191                    return resourceTypePermissionPersistence;
1192            }
1193    
1194            /**
1195             * Sets the resource type permission persistence.
1196             *
1197             * @param resourceTypePermissionPersistence the resource type permission persistence
1198             */
1199            public void setResourceTypePermissionPersistence(
1200                    ResourceTypePermissionPersistence resourceTypePermissionPersistence) {
1201                    this.resourceTypePermissionPersistence = resourceTypePermissionPersistence;
1202            }
1203    
1204            /**
1205             * Returns the resource type permission finder.
1206             *
1207             * @return the resource type permission finder
1208             */
1209            public ResourceTypePermissionFinder getResourceTypePermissionFinder() {
1210                    return resourceTypePermissionFinder;
1211            }
1212    
1213            /**
1214             * Sets the resource type permission finder.
1215             *
1216             * @param resourceTypePermissionFinder the resource type permission finder
1217             */
1218            public void setResourceTypePermissionFinder(
1219                    ResourceTypePermissionFinder resourceTypePermissionFinder) {
1220                    this.resourceTypePermissionFinder = resourceTypePermissionFinder;
1221            }
1222    
1223            /**
1224             * Returns the expando row local service.
1225             *
1226             * @return the expando row local service
1227             */
1228            public com.liferay.expando.kernel.service.ExpandoRowLocalService getExpandoRowLocalService() {
1229                    return expandoRowLocalService;
1230            }
1231    
1232            /**
1233             * Sets the expando row local service.
1234             *
1235             * @param expandoRowLocalService the expando row local service
1236             */
1237            public void setExpandoRowLocalService(
1238                    com.liferay.expando.kernel.service.ExpandoRowLocalService expandoRowLocalService) {
1239                    this.expandoRowLocalService = expandoRowLocalService;
1240            }
1241    
1242            /**
1243             * Returns the expando row persistence.
1244             *
1245             * @return the expando row persistence
1246             */
1247            public ExpandoRowPersistence getExpandoRowPersistence() {
1248                    return expandoRowPersistence;
1249            }
1250    
1251            /**
1252             * Sets the expando row persistence.
1253             *
1254             * @param expandoRowPersistence the expando row persistence
1255             */
1256            public void setExpandoRowPersistence(
1257                    ExpandoRowPersistence expandoRowPersistence) {
1258                    this.expandoRowPersistence = expandoRowPersistence;
1259            }
1260    
1261            /**
1262             * Returns the team local service.
1263             *
1264             * @return the team local service
1265             */
1266            public com.liferay.portal.kernel.service.TeamLocalService getTeamLocalService() {
1267                    return teamLocalService;
1268            }
1269    
1270            /**
1271             * Sets the team local service.
1272             *
1273             * @param teamLocalService the team local service
1274             */
1275            public void setTeamLocalService(
1276                    com.liferay.portal.kernel.service.TeamLocalService teamLocalService) {
1277                    this.teamLocalService = teamLocalService;
1278            }
1279    
1280            /**
1281             * Returns the team persistence.
1282             *
1283             * @return the team persistence
1284             */
1285            public TeamPersistence getTeamPersistence() {
1286                    return teamPersistence;
1287            }
1288    
1289            /**
1290             * Sets the team persistence.
1291             *
1292             * @param teamPersistence the team persistence
1293             */
1294            public void setTeamPersistence(TeamPersistence teamPersistence) {
1295                    this.teamPersistence = teamPersistence;
1296            }
1297    
1298            /**
1299             * Returns the team finder.
1300             *
1301             * @return the team finder
1302             */
1303            public TeamFinder getTeamFinder() {
1304                    return teamFinder;
1305            }
1306    
1307            /**
1308             * Sets the team finder.
1309             *
1310             * @param teamFinder the team finder
1311             */
1312            public void setTeamFinder(TeamFinder teamFinder) {
1313                    this.teamFinder = teamFinder;
1314            }
1315    
1316            /**
1317             * Returns the user local service.
1318             *
1319             * @return the user local service
1320             */
1321            public com.liferay.portal.kernel.service.UserLocalService getUserLocalService() {
1322                    return userLocalService;
1323            }
1324    
1325            /**
1326             * Sets the user local service.
1327             *
1328             * @param userLocalService the user local service
1329             */
1330            public void setUserLocalService(
1331                    com.liferay.portal.kernel.service.UserLocalService userLocalService) {
1332                    this.userLocalService = userLocalService;
1333            }
1334    
1335            /**
1336             * Returns the user persistence.
1337             *
1338             * @return the user persistence
1339             */
1340            public UserPersistence getUserPersistence() {
1341                    return userPersistence;
1342            }
1343    
1344            /**
1345             * Sets the user persistence.
1346             *
1347             * @param userPersistence the user persistence
1348             */
1349            public void setUserPersistence(UserPersistence userPersistence) {
1350                    this.userPersistence = userPersistence;
1351            }
1352    
1353            /**
1354             * Returns the user finder.
1355             *
1356             * @return the user finder
1357             */
1358            public UserFinder getUserFinder() {
1359                    return userFinder;
1360            }
1361    
1362            /**
1363             * Sets the user finder.
1364             *
1365             * @param userFinder the user finder
1366             */
1367            public void setUserFinder(UserFinder userFinder) {
1368                    this.userFinder = userFinder;
1369            }
1370    
1371            /**
1372             * Returns the user group group role local service.
1373             *
1374             * @return the user group group role local service
1375             */
1376            public com.liferay.portal.kernel.service.UserGroupGroupRoleLocalService getUserGroupGroupRoleLocalService() {
1377                    return userGroupGroupRoleLocalService;
1378            }
1379    
1380            /**
1381             * Sets the user group group role local service.
1382             *
1383             * @param userGroupGroupRoleLocalService the user group group role local service
1384             */
1385            public void setUserGroupGroupRoleLocalService(
1386                    com.liferay.portal.kernel.service.UserGroupGroupRoleLocalService userGroupGroupRoleLocalService) {
1387                    this.userGroupGroupRoleLocalService = userGroupGroupRoleLocalService;
1388            }
1389    
1390            /**
1391             * Returns the user group group role persistence.
1392             *
1393             * @return the user group group role persistence
1394             */
1395            public UserGroupGroupRolePersistence getUserGroupGroupRolePersistence() {
1396                    return userGroupGroupRolePersistence;
1397            }
1398    
1399            /**
1400             * Sets the user group group role persistence.
1401             *
1402             * @param userGroupGroupRolePersistence the user group group role persistence
1403             */
1404            public void setUserGroupGroupRolePersistence(
1405                    UserGroupGroupRolePersistence userGroupGroupRolePersistence) {
1406                    this.userGroupGroupRolePersistence = userGroupGroupRolePersistence;
1407            }
1408    
1409            /**
1410             * Returns the user group group role finder.
1411             *
1412             * @return the user group group role finder
1413             */
1414            public UserGroupGroupRoleFinder getUserGroupGroupRoleFinder() {
1415                    return userGroupGroupRoleFinder;
1416            }
1417    
1418            /**
1419             * Sets the user group group role finder.
1420             *
1421             * @param userGroupGroupRoleFinder the user group group role finder
1422             */
1423            public void setUserGroupGroupRoleFinder(
1424                    UserGroupGroupRoleFinder userGroupGroupRoleFinder) {
1425                    this.userGroupGroupRoleFinder = userGroupGroupRoleFinder;
1426            }
1427    
1428            /**
1429             * Returns the user group role local service.
1430             *
1431             * @return the user group role local service
1432             */
1433            public com.liferay.portal.kernel.service.UserGroupRoleLocalService getUserGroupRoleLocalService() {
1434                    return userGroupRoleLocalService;
1435            }
1436    
1437            /**
1438             * Sets the user group role local service.
1439             *
1440             * @param userGroupRoleLocalService the user group role local service
1441             */
1442            public void setUserGroupRoleLocalService(
1443                    com.liferay.portal.kernel.service.UserGroupRoleLocalService userGroupRoleLocalService) {
1444                    this.userGroupRoleLocalService = userGroupRoleLocalService;
1445            }
1446    
1447            /**
1448             * Returns the user group role persistence.
1449             *
1450             * @return the user group role persistence
1451             */
1452            public UserGroupRolePersistence getUserGroupRolePersistence() {
1453                    return userGroupRolePersistence;
1454            }
1455    
1456            /**
1457             * Sets the user group role persistence.
1458             *
1459             * @param userGroupRolePersistence the user group role persistence
1460             */
1461            public void setUserGroupRolePersistence(
1462                    UserGroupRolePersistence userGroupRolePersistence) {
1463                    this.userGroupRolePersistence = userGroupRolePersistence;
1464            }
1465    
1466            /**
1467             * Returns the user group role finder.
1468             *
1469             * @return the user group role finder
1470             */
1471            public UserGroupRoleFinder getUserGroupRoleFinder() {
1472                    return userGroupRoleFinder;
1473            }
1474    
1475            /**
1476             * Sets the user group role finder.
1477             *
1478             * @param userGroupRoleFinder the user group role finder
1479             */
1480            public void setUserGroupRoleFinder(UserGroupRoleFinder userGroupRoleFinder) {
1481                    this.userGroupRoleFinder = userGroupRoleFinder;
1482            }
1483    
1484            public void afterPropertiesSet() {
1485                    persistedModelLocalServiceRegistry.register("com.liferay.portal.kernel.model.Role",
1486                            roleLocalService);
1487            }
1488    
1489            public void destroy() {
1490                    persistedModelLocalServiceRegistry.unregister(
1491                            "com.liferay.portal.kernel.model.Role");
1492            }
1493    
1494            /**
1495             * Returns the OSGi service identifier.
1496             *
1497             * @return the OSGi service identifier
1498             */
1499            @Override
1500            public String getOSGiServiceIdentifier() {
1501                    return RoleLocalService.class.getName();
1502            }
1503    
1504            protected Class<?> getModelClass() {
1505                    return Role.class;
1506            }
1507    
1508            protected String getModelClassName() {
1509                    return Role.class.getName();
1510            }
1511    
1512            /**
1513             * Performs a SQL query.
1514             *
1515             * @param sql the sql query
1516             */
1517            protected void runSQL(String sql) {
1518                    try {
1519                            DataSource dataSource = rolePersistence.getDataSource();
1520    
1521                            DB db = DBManagerUtil.getDB();
1522    
1523                            sql = db.buildSQL(sql);
1524                            sql = PortalUtil.transformSQL(sql);
1525    
1526                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1527                                            sql);
1528    
1529                            sqlUpdate.update();
1530                    }
1531                    catch (Exception e) {
1532                            throw new SystemException(e);
1533                    }
1534            }
1535    
1536            @BeanReference(type = RoleLocalService.class)
1537            protected RoleLocalService roleLocalService;
1538            @BeanReference(type = RolePersistence.class)
1539            protected RolePersistence rolePersistence;
1540            @BeanReference(type = RoleFinder.class)
1541            protected RoleFinder roleFinder;
1542            @BeanReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
1543            protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
1544            @BeanReference(type = com.liferay.portal.kernel.service.ClassNameLocalService.class)
1545            protected com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService;
1546            @BeanReference(type = ClassNamePersistence.class)
1547            protected ClassNamePersistence classNamePersistence;
1548            @BeanReference(type = com.liferay.portal.kernel.service.CompanyLocalService.class)
1549            protected com.liferay.portal.kernel.service.CompanyLocalService companyLocalService;
1550            @BeanReference(type = CompanyPersistence.class)
1551            protected CompanyPersistence companyPersistence;
1552            @BeanReference(type = com.liferay.portal.kernel.service.GroupLocalService.class)
1553            protected com.liferay.portal.kernel.service.GroupLocalService groupLocalService;
1554            @BeanReference(type = GroupPersistence.class)
1555            protected GroupPersistence groupPersistence;
1556            @BeanReference(type = GroupFinder.class)
1557            protected GroupFinder groupFinder;
1558            @BeanReference(type = com.liferay.portal.kernel.service.LayoutLocalService.class)
1559            protected com.liferay.portal.kernel.service.LayoutLocalService layoutLocalService;
1560            @BeanReference(type = LayoutPersistence.class)
1561            protected LayoutPersistence layoutPersistence;
1562            @BeanReference(type = LayoutFinder.class)
1563            protected LayoutFinder layoutFinder;
1564            @BeanReference(type = com.liferay.portal.kernel.service.ResourceLocalService.class)
1565            protected com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService;
1566            @BeanReference(type = com.liferay.portal.kernel.service.ResourceActionLocalService.class)
1567            protected com.liferay.portal.kernel.service.ResourceActionLocalService resourceActionLocalService;
1568            @BeanReference(type = ResourceActionPersistence.class)
1569            protected ResourceActionPersistence resourceActionPersistence;
1570            @BeanReference(type = com.liferay.portal.kernel.service.ResourceBlockLocalService.class)
1571            protected com.liferay.portal.kernel.service.ResourceBlockLocalService resourceBlockLocalService;
1572            @BeanReference(type = ResourceBlockPersistence.class)
1573            protected ResourceBlockPersistence resourceBlockPersistence;
1574            @BeanReference(type = ResourceBlockFinder.class)
1575            protected ResourceBlockFinder resourceBlockFinder;
1576            @BeanReference(type = com.liferay.portal.kernel.service.ResourceBlockPermissionLocalService.class)
1577            protected com.liferay.portal.kernel.service.ResourceBlockPermissionLocalService resourceBlockPermissionLocalService;
1578            @BeanReference(type = ResourceBlockPermissionPersistence.class)
1579            protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
1580            @BeanReference(type = com.liferay.portal.kernel.service.ResourcePermissionLocalService.class)
1581            protected com.liferay.portal.kernel.service.ResourcePermissionLocalService resourcePermissionLocalService;
1582            @BeanReference(type = ResourcePermissionPersistence.class)
1583            protected ResourcePermissionPersistence resourcePermissionPersistence;
1584            @BeanReference(type = ResourcePermissionFinder.class)
1585            protected ResourcePermissionFinder resourcePermissionFinder;
1586            @BeanReference(type = com.liferay.portal.kernel.service.ResourceTypePermissionLocalService.class)
1587            protected com.liferay.portal.kernel.service.ResourceTypePermissionLocalService resourceTypePermissionLocalService;
1588            @BeanReference(type = ResourceTypePermissionPersistence.class)
1589            protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
1590            @BeanReference(type = ResourceTypePermissionFinder.class)
1591            protected ResourceTypePermissionFinder resourceTypePermissionFinder;
1592            @BeanReference(type = com.liferay.expando.kernel.service.ExpandoRowLocalService.class)
1593            protected com.liferay.expando.kernel.service.ExpandoRowLocalService expandoRowLocalService;
1594            @BeanReference(type = ExpandoRowPersistence.class)
1595            protected ExpandoRowPersistence expandoRowPersistence;
1596            @BeanReference(type = com.liferay.portal.kernel.service.TeamLocalService.class)
1597            protected com.liferay.portal.kernel.service.TeamLocalService teamLocalService;
1598            @BeanReference(type = TeamPersistence.class)
1599            protected TeamPersistence teamPersistence;
1600            @BeanReference(type = TeamFinder.class)
1601            protected TeamFinder teamFinder;
1602            @BeanReference(type = com.liferay.portal.kernel.service.UserLocalService.class)
1603            protected com.liferay.portal.kernel.service.UserLocalService userLocalService;
1604            @BeanReference(type = UserPersistence.class)
1605            protected UserPersistence userPersistence;
1606            @BeanReference(type = UserFinder.class)
1607            protected UserFinder userFinder;
1608            @BeanReference(type = com.liferay.portal.kernel.service.UserGroupGroupRoleLocalService.class)
1609            protected com.liferay.portal.kernel.service.UserGroupGroupRoleLocalService userGroupGroupRoleLocalService;
1610            @BeanReference(type = UserGroupGroupRolePersistence.class)
1611            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1612            @BeanReference(type = UserGroupGroupRoleFinder.class)
1613            protected UserGroupGroupRoleFinder userGroupGroupRoleFinder;
1614            @BeanReference(type = com.liferay.portal.kernel.service.UserGroupRoleLocalService.class)
1615            protected com.liferay.portal.kernel.service.UserGroupRoleLocalService userGroupRoleLocalService;
1616            @BeanReference(type = UserGroupRolePersistence.class)
1617            protected UserGroupRolePersistence userGroupRolePersistence;
1618            @BeanReference(type = UserGroupRoleFinder.class)
1619            protected UserGroupRoleFinder userGroupRoleFinder;
1620            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1621            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1622    }