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