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