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.exception.PortalException;
032    import com.liferay.portal.kernel.exception.SystemException;
033    import com.liferay.portal.kernel.lar.ExportImportHelperUtil;
034    import com.liferay.portal.kernel.lar.ManifestSummary;
035    import com.liferay.portal.kernel.lar.PortletDataContext;
036    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
037    import com.liferay.portal.kernel.lar.StagedModelType;
038    import com.liferay.portal.kernel.search.Indexable;
039    import com.liferay.portal.kernel.search.IndexableType;
040    import com.liferay.portal.kernel.util.OrderByComparator;
041    import com.liferay.portal.model.PasswordPolicy;
042    import com.liferay.portal.model.PersistedModel;
043    import com.liferay.portal.service.BaseLocalServiceImpl;
044    import com.liferay.portal.service.PasswordPolicyLocalService;
045    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
046    import com.liferay.portal.service.persistence.ClassNamePersistence;
047    import com.liferay.portal.service.persistence.PasswordPolicyFinder;
048    import com.liferay.portal.service.persistence.PasswordPolicyPersistence;
049    import com.liferay.portal.service.persistence.PasswordPolicyRelPersistence;
050    import com.liferay.portal.service.persistence.UserFinder;
051    import com.liferay.portal.service.persistence.UserPersistence;
052    import com.liferay.portal.util.PortalUtil;
053    
054    import java.io.Serializable;
055    
056    import java.util.List;
057    
058    import javax.sql.DataSource;
059    
060    /**
061     * Provides the base implementation for the password policy local service.
062     *
063     * <p>
064     * 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.PasswordPolicyLocalServiceImpl}.
065     * </p>
066     *
067     * @author Brian Wing Shun Chan
068     * @see com.liferay.portal.service.impl.PasswordPolicyLocalServiceImpl
069     * @see com.liferay.portal.service.PasswordPolicyLocalServiceUtil
070     * @generated
071     */
072    @ProviderType
073    public abstract class PasswordPolicyLocalServiceBaseImpl
074            extends BaseLocalServiceImpl implements PasswordPolicyLocalService,
075                    IdentifiableBean {
076            /*
077             * NOTE FOR DEVELOPERS:
078             *
079             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.PasswordPolicyLocalServiceUtil} to access the password policy local service.
080             */
081    
082            /**
083             * Adds the password policy to the database. Also notifies the appropriate model listeners.
084             *
085             * @param passwordPolicy the password policy
086             * @return the password policy that was added
087             */
088            @Indexable(type = IndexableType.REINDEX)
089            @Override
090            public PasswordPolicy addPasswordPolicy(PasswordPolicy passwordPolicy) {
091                    passwordPolicy.setNew(true);
092    
093                    return passwordPolicyPersistence.update(passwordPolicy);
094            }
095    
096            /**
097             * Creates a new password policy with the primary key. Does not add the password policy to the database.
098             *
099             * @param passwordPolicyId the primary key for the new password policy
100             * @return the new password policy
101             */
102            @Override
103            public PasswordPolicy createPasswordPolicy(long passwordPolicyId) {
104                    return passwordPolicyPersistence.create(passwordPolicyId);
105            }
106    
107            /**
108             * Deletes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
109             *
110             * @param passwordPolicyId the primary key of the password policy
111             * @return the password policy that was removed
112             * @throws PortalException if a password policy with the primary key could not be found
113             */
114            @Indexable(type = IndexableType.DELETE)
115            @Override
116            public PasswordPolicy deletePasswordPolicy(long passwordPolicyId)
117                    throws PortalException {
118                    return passwordPolicyPersistence.remove(passwordPolicyId);
119            }
120    
121            /**
122             * Deletes the password policy from the database. Also notifies the appropriate model listeners.
123             *
124             * @param passwordPolicy the password policy
125             * @return the password policy that was removed
126             * @throws PortalException
127             */
128            @Indexable(type = IndexableType.DELETE)
129            @Override
130            public PasswordPolicy deletePasswordPolicy(PasswordPolicy passwordPolicy)
131                    throws PortalException {
132                    return passwordPolicyPersistence.remove(passwordPolicy);
133            }
134    
135            @Override
136            public DynamicQuery dynamicQuery() {
137                    Class<?> clazz = getClass();
138    
139                    return DynamicQueryFactoryUtil.forClass(PasswordPolicy.class,
140                            clazz.getClassLoader());
141            }
142    
143            /**
144             * Performs a dynamic query on the database and returns the matching rows.
145             *
146             * @param dynamicQuery the dynamic query
147             * @return the matching rows
148             */
149            @Override
150            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
151                    return passwordPolicyPersistence.findWithDynamicQuery(dynamicQuery);
152            }
153    
154            /**
155             * Performs a dynamic query on the database and returns a range of the matching rows.
156             *
157             * <p>
158             * 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.PasswordPolicyModelImpl}. 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.
159             * </p>
160             *
161             * @param dynamicQuery the dynamic query
162             * @param start the lower bound of the range of model instances
163             * @param end the upper bound of the range of model instances (not inclusive)
164             * @return the range of matching rows
165             */
166            @Override
167            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
168                    int end) {
169                    return passwordPolicyPersistence.findWithDynamicQuery(dynamicQuery,
170                            start, end);
171            }
172    
173            /**
174             * Performs a dynamic query on the database and returns an ordered 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.PasswordPolicyModelImpl}. 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             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
184             * @return the ordered range of matching rows
185             */
186            @Override
187            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
188                    int end, OrderByComparator<T> orderByComparator) {
189                    return passwordPolicyPersistence.findWithDynamicQuery(dynamicQuery,
190                            start, end, orderByComparator);
191            }
192    
193            /**
194             * Returns the number of rows matching the dynamic query.
195             *
196             * @param dynamicQuery the dynamic query
197             * @return the number of rows matching the dynamic query
198             */
199            @Override
200            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
201                    return passwordPolicyPersistence.countWithDynamicQuery(dynamicQuery);
202            }
203    
204            /**
205             * Returns the number of rows matching the dynamic query.
206             *
207             * @param dynamicQuery the dynamic query
208             * @param projection the projection to apply to the query
209             * @return the number of rows matching the dynamic query
210             */
211            @Override
212            public long dynamicQueryCount(DynamicQuery dynamicQuery,
213                    Projection projection) {
214                    return passwordPolicyPersistence.countWithDynamicQuery(dynamicQuery,
215                            projection);
216            }
217    
218            @Override
219            public PasswordPolicy fetchPasswordPolicy(long passwordPolicyId) {
220                    return passwordPolicyPersistence.fetchByPrimaryKey(passwordPolicyId);
221            }
222    
223            /**
224             * Returns the password policy with the matching UUID and company.
225             *
226             * @param uuid the password policy's UUID
227             * @param companyId the primary key of the company
228             * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
229             */
230            @Override
231            public PasswordPolicy fetchPasswordPolicyByUuidAndCompanyId(String uuid,
232                    long companyId) {
233                    return passwordPolicyPersistence.fetchByUuid_C_First(uuid, companyId,
234                            null);
235            }
236    
237            /**
238             * Returns the password policy with the primary key.
239             *
240             * @param passwordPolicyId the primary key of the password policy
241             * @return the password policy
242             * @throws PortalException if a password policy with the primary key could not be found
243             */
244            @Override
245            public PasswordPolicy getPasswordPolicy(long passwordPolicyId)
246                    throws PortalException {
247                    return passwordPolicyPersistence.findByPrimaryKey(passwordPolicyId);
248            }
249    
250            @Override
251            public ActionableDynamicQuery getActionableDynamicQuery() {
252                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
253    
254                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.PasswordPolicyLocalServiceUtil.getService());
255                    actionableDynamicQuery.setClass(PasswordPolicy.class);
256                    actionableDynamicQuery.setClassLoader(getClassLoader());
257    
258                    actionableDynamicQuery.setPrimaryKeyPropertyName("passwordPolicyId");
259    
260                    return actionableDynamicQuery;
261            }
262    
263            protected void initActionableDynamicQuery(
264                    ActionableDynamicQuery actionableDynamicQuery) {
265                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.PasswordPolicyLocalServiceUtil.getService());
266                    actionableDynamicQuery.setClass(PasswordPolicy.class);
267                    actionableDynamicQuery.setClassLoader(getClassLoader());
268    
269                    actionableDynamicQuery.setPrimaryKeyPropertyName("passwordPolicyId");
270            }
271    
272            @Override
273            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
274                    final PortletDataContext portletDataContext) {
275                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
276                                    @Override
277                                    public long performCount() throws PortalException {
278                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
279    
280                                            StagedModelType stagedModelType = getStagedModelType();
281    
282                                            long modelAdditionCount = super.performCount();
283    
284                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
285                                                    modelAdditionCount);
286    
287                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
288                                                            stagedModelType);
289    
290                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
291                                                    modelDeletionCount);
292    
293                                            return modelAdditionCount;
294                                    }
295                            };
296    
297                    initActionableDynamicQuery(exportActionableDynamicQuery);
298    
299                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
300                                    @Override
301                                    public void addCriteria(DynamicQuery dynamicQuery) {
302                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
303                                                    "modifiedDate");
304                                    }
305                            });
306    
307                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
308    
309                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
310                                    @Override
311                                    public void performAction(Object object)
312                                            throws PortalException {
313                                            PasswordPolicy stagedModel = (PasswordPolicy)object;
314    
315                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
316                                                    stagedModel);
317                                    }
318                            });
319                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
320                                    PortalUtil.getClassNameId(PasswordPolicy.class.getName())));
321    
322                    return exportActionableDynamicQuery;
323            }
324    
325            /**
326             * @throws PortalException
327             */
328            @Override
329            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
330                    throws PortalException {
331                    return passwordPolicyLocalService.deletePasswordPolicy((PasswordPolicy)persistedModel);
332            }
333    
334            @Override
335            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
336                    throws PortalException {
337                    return passwordPolicyPersistence.findByPrimaryKey(primaryKeyObj);
338            }
339    
340            /**
341             * Returns the password policy with the matching UUID and company.
342             *
343             * @param uuid the password policy's UUID
344             * @param companyId the primary key of the company
345             * @return the matching password policy
346             * @throws PortalException if a matching password policy could not be found
347             */
348            @Override
349            public PasswordPolicy getPasswordPolicyByUuidAndCompanyId(String uuid,
350                    long companyId) throws PortalException {
351                    return passwordPolicyPersistence.findByUuid_C_First(uuid, companyId,
352                            null);
353            }
354    
355            /**
356             * Returns a range of all the password policies.
357             *
358             * <p>
359             * 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.PasswordPolicyModelImpl}. 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.
360             * </p>
361             *
362             * @param start the lower bound of the range of password policies
363             * @param end the upper bound of the range of password policies (not inclusive)
364             * @return the range of password policies
365             */
366            @Override
367            public List<PasswordPolicy> getPasswordPolicies(int start, int end) {
368                    return passwordPolicyPersistence.findAll(start, end);
369            }
370    
371            /**
372             * Returns the number of password policies.
373             *
374             * @return the number of password policies
375             */
376            @Override
377            public int getPasswordPoliciesCount() {
378                    return passwordPolicyPersistence.countAll();
379            }
380    
381            /**
382             * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
383             *
384             * @param passwordPolicy the password policy
385             * @return the password policy that was updated
386             */
387            @Indexable(type = IndexableType.REINDEX)
388            @Override
389            public PasswordPolicy updatePasswordPolicy(PasswordPolicy passwordPolicy) {
390                    return passwordPolicyPersistence.update(passwordPolicy);
391            }
392    
393            /**
394             * Returns the password policy local service.
395             *
396             * @return the password policy local service
397             */
398            public com.liferay.portal.service.PasswordPolicyLocalService getPasswordPolicyLocalService() {
399                    return passwordPolicyLocalService;
400            }
401    
402            /**
403             * Sets the password policy local service.
404             *
405             * @param passwordPolicyLocalService the password policy local service
406             */
407            public void setPasswordPolicyLocalService(
408                    com.liferay.portal.service.PasswordPolicyLocalService passwordPolicyLocalService) {
409                    this.passwordPolicyLocalService = passwordPolicyLocalService;
410            }
411    
412            /**
413             * Returns the password policy remote service.
414             *
415             * @return the password policy remote service
416             */
417            public com.liferay.portal.service.PasswordPolicyService getPasswordPolicyService() {
418                    return passwordPolicyService;
419            }
420    
421            /**
422             * Sets the password policy remote service.
423             *
424             * @param passwordPolicyService the password policy remote service
425             */
426            public void setPasswordPolicyService(
427                    com.liferay.portal.service.PasswordPolicyService passwordPolicyService) {
428                    this.passwordPolicyService = passwordPolicyService;
429            }
430    
431            /**
432             * Returns the password policy persistence.
433             *
434             * @return the password policy persistence
435             */
436            public PasswordPolicyPersistence getPasswordPolicyPersistence() {
437                    return passwordPolicyPersistence;
438            }
439    
440            /**
441             * Sets the password policy persistence.
442             *
443             * @param passwordPolicyPersistence the password policy persistence
444             */
445            public void setPasswordPolicyPersistence(
446                    PasswordPolicyPersistence passwordPolicyPersistence) {
447                    this.passwordPolicyPersistence = passwordPolicyPersistence;
448            }
449    
450            /**
451             * Returns the password policy finder.
452             *
453             * @return the password policy finder
454             */
455            public PasswordPolicyFinder getPasswordPolicyFinder() {
456                    return passwordPolicyFinder;
457            }
458    
459            /**
460             * Sets the password policy finder.
461             *
462             * @param passwordPolicyFinder the password policy finder
463             */
464            public void setPasswordPolicyFinder(
465                    PasswordPolicyFinder passwordPolicyFinder) {
466                    this.passwordPolicyFinder = passwordPolicyFinder;
467            }
468    
469            /**
470             * Returns the counter local service.
471             *
472             * @return the counter local service
473             */
474            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
475                    return counterLocalService;
476            }
477    
478            /**
479             * Sets the counter local service.
480             *
481             * @param counterLocalService the counter local service
482             */
483            public void setCounterLocalService(
484                    com.liferay.counter.service.CounterLocalService counterLocalService) {
485                    this.counterLocalService = counterLocalService;
486            }
487    
488            /**
489             * Returns the class name local service.
490             *
491             * @return the class name local service
492             */
493            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
494                    return classNameLocalService;
495            }
496    
497            /**
498             * Sets the class name local service.
499             *
500             * @param classNameLocalService the class name local service
501             */
502            public void setClassNameLocalService(
503                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
504                    this.classNameLocalService = classNameLocalService;
505            }
506    
507            /**
508             * Returns the class name remote service.
509             *
510             * @return the class name remote service
511             */
512            public com.liferay.portal.service.ClassNameService getClassNameService() {
513                    return classNameService;
514            }
515    
516            /**
517             * Sets the class name remote service.
518             *
519             * @param classNameService the class name remote service
520             */
521            public void setClassNameService(
522                    com.liferay.portal.service.ClassNameService classNameService) {
523                    this.classNameService = classNameService;
524            }
525    
526            /**
527             * Returns the class name persistence.
528             *
529             * @return the class name persistence
530             */
531            public ClassNamePersistence getClassNamePersistence() {
532                    return classNamePersistence;
533            }
534    
535            /**
536             * Sets the class name persistence.
537             *
538             * @param classNamePersistence the class name persistence
539             */
540            public void setClassNamePersistence(
541                    ClassNamePersistence classNamePersistence) {
542                    this.classNamePersistence = classNamePersistence;
543            }
544    
545            /**
546             * Returns the password policy rel local service.
547             *
548             * @return the password policy rel local service
549             */
550            public com.liferay.portal.service.PasswordPolicyRelLocalService getPasswordPolicyRelLocalService() {
551                    return passwordPolicyRelLocalService;
552            }
553    
554            /**
555             * Sets the password policy rel local service.
556             *
557             * @param passwordPolicyRelLocalService the password policy rel local service
558             */
559            public void setPasswordPolicyRelLocalService(
560                    com.liferay.portal.service.PasswordPolicyRelLocalService passwordPolicyRelLocalService) {
561                    this.passwordPolicyRelLocalService = passwordPolicyRelLocalService;
562            }
563    
564            /**
565             * Returns the password policy rel persistence.
566             *
567             * @return the password policy rel persistence
568             */
569            public PasswordPolicyRelPersistence getPasswordPolicyRelPersistence() {
570                    return passwordPolicyRelPersistence;
571            }
572    
573            /**
574             * Sets the password policy rel persistence.
575             *
576             * @param passwordPolicyRelPersistence the password policy rel persistence
577             */
578            public void setPasswordPolicyRelPersistence(
579                    PasswordPolicyRelPersistence passwordPolicyRelPersistence) {
580                    this.passwordPolicyRelPersistence = passwordPolicyRelPersistence;
581            }
582    
583            /**
584             * Returns the resource local service.
585             *
586             * @return the resource local service
587             */
588            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
589                    return resourceLocalService;
590            }
591    
592            /**
593             * Sets the resource local service.
594             *
595             * @param resourceLocalService the resource local service
596             */
597            public void setResourceLocalService(
598                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
599                    this.resourceLocalService = resourceLocalService;
600            }
601    
602            /**
603             * Returns the user local service.
604             *
605             * @return the user local service
606             */
607            public com.liferay.portal.service.UserLocalService getUserLocalService() {
608                    return userLocalService;
609            }
610    
611            /**
612             * Sets the user local service.
613             *
614             * @param userLocalService the user local service
615             */
616            public void setUserLocalService(
617                    com.liferay.portal.service.UserLocalService userLocalService) {
618                    this.userLocalService = userLocalService;
619            }
620    
621            /**
622             * Returns the user remote service.
623             *
624             * @return the user remote service
625             */
626            public com.liferay.portal.service.UserService getUserService() {
627                    return userService;
628            }
629    
630            /**
631             * Sets the user remote service.
632             *
633             * @param userService the user remote service
634             */
635            public void setUserService(
636                    com.liferay.portal.service.UserService userService) {
637                    this.userService = userService;
638            }
639    
640            /**
641             * Returns the user persistence.
642             *
643             * @return the user persistence
644             */
645            public UserPersistence getUserPersistence() {
646                    return userPersistence;
647            }
648    
649            /**
650             * Sets the user persistence.
651             *
652             * @param userPersistence the user persistence
653             */
654            public void setUserPersistence(UserPersistence userPersistence) {
655                    this.userPersistence = userPersistence;
656            }
657    
658            /**
659             * Returns the user finder.
660             *
661             * @return the user finder
662             */
663            public UserFinder getUserFinder() {
664                    return userFinder;
665            }
666    
667            /**
668             * Sets the user finder.
669             *
670             * @param userFinder the user finder
671             */
672            public void setUserFinder(UserFinder userFinder) {
673                    this.userFinder = userFinder;
674            }
675    
676            public void afterPropertiesSet() {
677                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.PasswordPolicy",
678                            passwordPolicyLocalService);
679            }
680    
681            public void destroy() {
682                    persistedModelLocalServiceRegistry.unregister(
683                            "com.liferay.portal.model.PasswordPolicy");
684            }
685    
686            /**
687             * Returns the Spring bean ID for this bean.
688             *
689             * @return the Spring bean ID for this bean
690             */
691            @Override
692            public String getBeanIdentifier() {
693                    return _beanIdentifier;
694            }
695    
696            /**
697             * Sets the Spring bean ID for this bean.
698             *
699             * @param beanIdentifier the Spring bean ID for this bean
700             */
701            @Override
702            public void setBeanIdentifier(String beanIdentifier) {
703                    _beanIdentifier = beanIdentifier;
704            }
705    
706            protected Class<?> getModelClass() {
707                    return PasswordPolicy.class;
708            }
709    
710            protected String getModelClassName() {
711                    return PasswordPolicy.class.getName();
712            }
713    
714            /**
715             * Performs a SQL query.
716             *
717             * @param sql the sql query
718             */
719            protected void runSQL(String sql) {
720                    try {
721                            DataSource dataSource = passwordPolicyPersistence.getDataSource();
722    
723                            DB db = DBFactoryUtil.getDB();
724    
725                            sql = db.buildSQL(sql);
726                            sql = PortalUtil.transformSQL(sql);
727    
728                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
729                                            sql, new int[0]);
730    
731                            sqlUpdate.update();
732                    }
733                    catch (Exception e) {
734                            throw new SystemException(e);
735                    }
736            }
737    
738            @BeanReference(type = com.liferay.portal.service.PasswordPolicyLocalService.class)
739            protected com.liferay.portal.service.PasswordPolicyLocalService passwordPolicyLocalService;
740            @BeanReference(type = com.liferay.portal.service.PasswordPolicyService.class)
741            protected com.liferay.portal.service.PasswordPolicyService passwordPolicyService;
742            @BeanReference(type = PasswordPolicyPersistence.class)
743            protected PasswordPolicyPersistence passwordPolicyPersistence;
744            @BeanReference(type = PasswordPolicyFinder.class)
745            protected PasswordPolicyFinder passwordPolicyFinder;
746            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
747            protected com.liferay.counter.service.CounterLocalService counterLocalService;
748            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
749            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
750            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
751            protected com.liferay.portal.service.ClassNameService classNameService;
752            @BeanReference(type = ClassNamePersistence.class)
753            protected ClassNamePersistence classNamePersistence;
754            @BeanReference(type = com.liferay.portal.service.PasswordPolicyRelLocalService.class)
755            protected com.liferay.portal.service.PasswordPolicyRelLocalService passwordPolicyRelLocalService;
756            @BeanReference(type = PasswordPolicyRelPersistence.class)
757            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
758            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
759            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
760            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
761            protected com.liferay.portal.service.UserLocalService userLocalService;
762            @BeanReference(type = com.liferay.portal.service.UserService.class)
763            protected com.liferay.portal.service.UserService userService;
764            @BeanReference(type = UserPersistence.class)
765            protected UserPersistence userPersistence;
766            @BeanReference(type = UserFinder.class)
767            protected UserFinder userFinder;
768            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
769            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
770            private String _beanIdentifier;
771    }