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,
286                                                    modelAdditionCount);
287    
288                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
289                                                            stagedModelType);
290    
291                                            manifestSummary.addModelDeletionCount(stagedModelType,
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<PasswordPolicy>() {
311                                    @Override
312                                    public void performAction(PasswordPolicy passwordPolicy)
313                                            throws PortalException {
314                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
315                                                    passwordPolicy);
316                                    }
317                            });
318                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
319                                    PortalUtil.getClassNameId(PasswordPolicy.class.getName())));
320    
321                    return exportActionableDynamicQuery;
322            }
323    
324            /**
325             * @throws PortalException
326             */
327            @Override
328            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
329                    throws PortalException {
330                    return passwordPolicyLocalService.deletePasswordPolicy((PasswordPolicy)persistedModel);
331            }
332    
333            @Override
334            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
335                    throws PortalException {
336                    return passwordPolicyPersistence.findByPrimaryKey(primaryKeyObj);
337            }
338    
339            /**
340             * Returns the password policy with the matching UUID and company.
341             *
342             * @param uuid the password policy's UUID
343             * @param companyId the primary key of the company
344             * @return the matching password policy
345             * @throws PortalException if a matching password policy could not be found
346             */
347            @Override
348            public PasswordPolicy getPasswordPolicyByUuidAndCompanyId(String uuid,
349                    long companyId) throws PortalException {
350                    return passwordPolicyPersistence.findByUuid_C_First(uuid, companyId,
351                            null);
352            }
353    
354            /**
355             * Returns a range of all the password policies.
356             *
357             * <p>
358             * 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.
359             * </p>
360             *
361             * @param start the lower bound of the range of password policies
362             * @param end the upper bound of the range of password policies (not inclusive)
363             * @return the range of password policies
364             */
365            @Override
366            public List<PasswordPolicy> getPasswordPolicies(int start, int end) {
367                    return passwordPolicyPersistence.findAll(start, end);
368            }
369    
370            /**
371             * Returns the number of password policies.
372             *
373             * @return the number of password policies
374             */
375            @Override
376            public int getPasswordPoliciesCount() {
377                    return passwordPolicyPersistence.countAll();
378            }
379    
380            /**
381             * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
382             *
383             * @param passwordPolicy the password policy
384             * @return the password policy that was updated
385             */
386            @Indexable(type = IndexableType.REINDEX)
387            @Override
388            public PasswordPolicy updatePasswordPolicy(PasswordPolicy passwordPolicy) {
389                    return passwordPolicyPersistence.update(passwordPolicy);
390            }
391    
392            /**
393             * Returns the password policy local service.
394             *
395             * @return the password policy local service
396             */
397            public PasswordPolicyLocalService getPasswordPolicyLocalService() {
398                    return passwordPolicyLocalService;
399            }
400    
401            /**
402             * Sets the password policy local service.
403             *
404             * @param passwordPolicyLocalService the password policy local service
405             */
406            public void setPasswordPolicyLocalService(
407                    PasswordPolicyLocalService passwordPolicyLocalService) {
408                    this.passwordPolicyLocalService = passwordPolicyLocalService;
409            }
410    
411            /**
412             * Returns the password policy remote service.
413             *
414             * @return the password policy remote service
415             */
416            public com.liferay.portal.service.PasswordPolicyService getPasswordPolicyService() {
417                    return passwordPolicyService;
418            }
419    
420            /**
421             * Sets the password policy remote service.
422             *
423             * @param passwordPolicyService the password policy remote service
424             */
425            public void setPasswordPolicyService(
426                    com.liferay.portal.service.PasswordPolicyService passwordPolicyService) {
427                    this.passwordPolicyService = passwordPolicyService;
428            }
429    
430            /**
431             * Returns the password policy persistence.
432             *
433             * @return the password policy persistence
434             */
435            public PasswordPolicyPersistence getPasswordPolicyPersistence() {
436                    return passwordPolicyPersistence;
437            }
438    
439            /**
440             * Sets the password policy persistence.
441             *
442             * @param passwordPolicyPersistence the password policy persistence
443             */
444            public void setPasswordPolicyPersistence(
445                    PasswordPolicyPersistence passwordPolicyPersistence) {
446                    this.passwordPolicyPersistence = passwordPolicyPersistence;
447            }
448    
449            /**
450             * Returns the password policy finder.
451             *
452             * @return the password policy finder
453             */
454            public PasswordPolicyFinder getPasswordPolicyFinder() {
455                    return passwordPolicyFinder;
456            }
457    
458            /**
459             * Sets the password policy finder.
460             *
461             * @param passwordPolicyFinder the password policy finder
462             */
463            public void setPasswordPolicyFinder(
464                    PasswordPolicyFinder passwordPolicyFinder) {
465                    this.passwordPolicyFinder = passwordPolicyFinder;
466            }
467    
468            /**
469             * Returns the counter local service.
470             *
471             * @return the counter local service
472             */
473            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
474                    return counterLocalService;
475            }
476    
477            /**
478             * Sets the counter local service.
479             *
480             * @param counterLocalService the counter local service
481             */
482            public void setCounterLocalService(
483                    com.liferay.counter.service.CounterLocalService counterLocalService) {
484                    this.counterLocalService = counterLocalService;
485            }
486    
487            /**
488             * Returns the class name local service.
489             *
490             * @return the class name local service
491             */
492            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
493                    return classNameLocalService;
494            }
495    
496            /**
497             * Sets the class name local service.
498             *
499             * @param classNameLocalService the class name local service
500             */
501            public void setClassNameLocalService(
502                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
503                    this.classNameLocalService = classNameLocalService;
504            }
505    
506            /**
507             * Returns the class name remote service.
508             *
509             * @return the class name remote service
510             */
511            public com.liferay.portal.service.ClassNameService getClassNameService() {
512                    return classNameService;
513            }
514    
515            /**
516             * Sets the class name remote service.
517             *
518             * @param classNameService the class name remote service
519             */
520            public void setClassNameService(
521                    com.liferay.portal.service.ClassNameService classNameService) {
522                    this.classNameService = classNameService;
523            }
524    
525            /**
526             * Returns the class name persistence.
527             *
528             * @return the class name persistence
529             */
530            public ClassNamePersistence getClassNamePersistence() {
531                    return classNamePersistence;
532            }
533    
534            /**
535             * Sets the class name persistence.
536             *
537             * @param classNamePersistence the class name persistence
538             */
539            public void setClassNamePersistence(
540                    ClassNamePersistence classNamePersistence) {
541                    this.classNamePersistence = classNamePersistence;
542            }
543    
544            /**
545             * Returns the password policy rel local service.
546             *
547             * @return the password policy rel local service
548             */
549            public com.liferay.portal.service.PasswordPolicyRelLocalService getPasswordPolicyRelLocalService() {
550                    return passwordPolicyRelLocalService;
551            }
552    
553            /**
554             * Sets the password policy rel local service.
555             *
556             * @param passwordPolicyRelLocalService the password policy rel local service
557             */
558            public void setPasswordPolicyRelLocalService(
559                    com.liferay.portal.service.PasswordPolicyRelLocalService passwordPolicyRelLocalService) {
560                    this.passwordPolicyRelLocalService = passwordPolicyRelLocalService;
561            }
562    
563            /**
564             * Returns the password policy rel persistence.
565             *
566             * @return the password policy rel persistence
567             */
568            public PasswordPolicyRelPersistence getPasswordPolicyRelPersistence() {
569                    return passwordPolicyRelPersistence;
570            }
571    
572            /**
573             * Sets the password policy rel persistence.
574             *
575             * @param passwordPolicyRelPersistence the password policy rel persistence
576             */
577            public void setPasswordPolicyRelPersistence(
578                    PasswordPolicyRelPersistence passwordPolicyRelPersistence) {
579                    this.passwordPolicyRelPersistence = passwordPolicyRelPersistence;
580            }
581    
582            /**
583             * Returns the resource local service.
584             *
585             * @return the resource local service
586             */
587            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
588                    return resourceLocalService;
589            }
590    
591            /**
592             * Sets the resource local service.
593             *
594             * @param resourceLocalService the resource local service
595             */
596            public void setResourceLocalService(
597                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
598                    this.resourceLocalService = resourceLocalService;
599            }
600    
601            /**
602             * Returns the user local service.
603             *
604             * @return the user local service
605             */
606            public com.liferay.portal.service.UserLocalService getUserLocalService() {
607                    return userLocalService;
608            }
609    
610            /**
611             * Sets the user local service.
612             *
613             * @param userLocalService the user local service
614             */
615            public void setUserLocalService(
616                    com.liferay.portal.service.UserLocalService userLocalService) {
617                    this.userLocalService = userLocalService;
618            }
619    
620            /**
621             * Returns the user remote service.
622             *
623             * @return the user remote service
624             */
625            public com.liferay.portal.service.UserService getUserService() {
626                    return userService;
627            }
628    
629            /**
630             * Sets the user remote service.
631             *
632             * @param userService the user remote service
633             */
634            public void setUserService(
635                    com.liferay.portal.service.UserService userService) {
636                    this.userService = userService;
637            }
638    
639            /**
640             * Returns the user persistence.
641             *
642             * @return the user persistence
643             */
644            public UserPersistence getUserPersistence() {
645                    return userPersistence;
646            }
647    
648            /**
649             * Sets the user persistence.
650             *
651             * @param userPersistence the user persistence
652             */
653            public void setUserPersistence(UserPersistence userPersistence) {
654                    this.userPersistence = userPersistence;
655            }
656    
657            /**
658             * Returns the user finder.
659             *
660             * @return the user finder
661             */
662            public UserFinder getUserFinder() {
663                    return userFinder;
664            }
665    
666            /**
667             * Sets the user finder.
668             *
669             * @param userFinder the user finder
670             */
671            public void setUserFinder(UserFinder userFinder) {
672                    this.userFinder = userFinder;
673            }
674    
675            public void afterPropertiesSet() {
676                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.PasswordPolicy",
677                            passwordPolicyLocalService);
678            }
679    
680            public void destroy() {
681                    persistedModelLocalServiceRegistry.unregister(
682                            "com.liferay.portal.model.PasswordPolicy");
683            }
684    
685            /**
686             * Returns the Spring bean ID for this bean.
687             *
688             * @return the Spring bean ID for this bean
689             */
690            @Override
691            public String getBeanIdentifier() {
692                    return _beanIdentifier;
693            }
694    
695            /**
696             * Sets the Spring bean ID for this bean.
697             *
698             * @param beanIdentifier the Spring bean ID for this bean
699             */
700            @Override
701            public void setBeanIdentifier(String beanIdentifier) {
702                    _beanIdentifier = beanIdentifier;
703            }
704    
705            protected Class<?> getModelClass() {
706                    return PasswordPolicy.class;
707            }
708    
709            protected String getModelClassName() {
710                    return PasswordPolicy.class.getName();
711            }
712    
713            /**
714             * Performs a SQL query.
715             *
716             * @param sql the sql query
717             */
718            protected void runSQL(String sql) {
719                    try {
720                            DataSource dataSource = passwordPolicyPersistence.getDataSource();
721    
722                            DB db = DBFactoryUtil.getDB();
723    
724                            sql = db.buildSQL(sql);
725                            sql = PortalUtil.transformSQL(sql);
726    
727                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
728                                            sql, new int[0]);
729    
730                            sqlUpdate.update();
731                    }
732                    catch (Exception e) {
733                            throw new SystemException(e);
734                    }
735            }
736    
737            @BeanReference(type = com.liferay.portal.service.PasswordPolicyLocalService.class)
738            protected PasswordPolicyLocalService passwordPolicyLocalService;
739            @BeanReference(type = com.liferay.portal.service.PasswordPolicyService.class)
740            protected com.liferay.portal.service.PasswordPolicyService passwordPolicyService;
741            @BeanReference(type = PasswordPolicyPersistence.class)
742            protected PasswordPolicyPersistence passwordPolicyPersistence;
743            @BeanReference(type = PasswordPolicyFinder.class)
744            protected PasswordPolicyFinder passwordPolicyFinder;
745            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
746            protected com.liferay.counter.service.CounterLocalService counterLocalService;
747            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
748            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
749            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
750            protected com.liferay.portal.service.ClassNameService classNameService;
751            @BeanReference(type = ClassNamePersistence.class)
752            protected ClassNamePersistence classNamePersistence;
753            @BeanReference(type = com.liferay.portal.service.PasswordPolicyRelLocalService.class)
754            protected com.liferay.portal.service.PasswordPolicyRelLocalService passwordPolicyRelLocalService;
755            @BeanReference(type = PasswordPolicyRelPersistence.class)
756            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
757            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
758            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
759            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
760            protected com.liferay.portal.service.UserLocalService userLocalService;
761            @BeanReference(type = com.liferay.portal.service.UserService.class)
762            protected com.liferay.portal.service.UserService userService;
763            @BeanReference(type = UserPersistence.class)
764            protected UserPersistence userPersistence;
765            @BeanReference(type = UserFinder.class)
766            protected UserFinder userFinder;
767            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
768            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
769            private String _beanIdentifier;
770    }