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.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.dao.orm.Property;
032    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
033    import com.liferay.portal.kernel.exception.PortalException;
034    import com.liferay.portal.kernel.exception.SystemException;
035    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
036    import com.liferay.portal.kernel.search.Indexable;
037    import com.liferay.portal.kernel.search.IndexableType;
038    import com.liferay.portal.kernel.util.OrderByComparator;
039    import com.liferay.portal.model.EmailAddress;
040    import com.liferay.portal.model.PersistedModel;
041    import com.liferay.portal.service.BaseLocalServiceImpl;
042    import com.liferay.portal.service.EmailAddressLocalService;
043    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
044    import com.liferay.portal.service.persistence.ClassNamePersistence;
045    import com.liferay.portal.service.persistence.EmailAddressPersistence;
046    import com.liferay.portal.service.persistence.ListTypePersistence;
047    import com.liferay.portal.service.persistence.UserFinder;
048    import com.liferay.portal.service.persistence.UserPersistence;
049    import com.liferay.portal.util.PortalUtil;
050    
051    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
052    import com.liferay.portlet.exportimport.lar.ManifestSummary;
053    import com.liferay.portlet.exportimport.lar.PortletDataContext;
054    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
055    import com.liferay.portlet.exportimport.lar.StagedModelType;
056    
057    import java.io.Serializable;
058    
059    import java.util.List;
060    
061    import javax.sql.DataSource;
062    
063    /**
064     * Provides the base implementation for the email address local service.
065     *
066     * <p>
067     * 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.EmailAddressLocalServiceImpl}.
068     * </p>
069     *
070     * @author Brian Wing Shun Chan
071     * @see com.liferay.portal.service.impl.EmailAddressLocalServiceImpl
072     * @see com.liferay.portal.service.EmailAddressLocalServiceUtil
073     * @generated
074     */
075    @ProviderType
076    public abstract class EmailAddressLocalServiceBaseImpl
077            extends BaseLocalServiceImpl implements EmailAddressLocalService,
078                    IdentifiableOSGiService {
079            /*
080             * NOTE FOR DEVELOPERS:
081             *
082             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.EmailAddressLocalServiceUtil} to access the email address local service.
083             */
084    
085            /**
086             * Adds the email address to the database. Also notifies the appropriate model listeners.
087             *
088             * @param emailAddress the email address
089             * @return the email address that was added
090             */
091            @Indexable(type = IndexableType.REINDEX)
092            @Override
093            public EmailAddress addEmailAddress(EmailAddress emailAddress) {
094                    emailAddress.setNew(true);
095    
096                    return emailAddressPersistence.update(emailAddress);
097            }
098    
099            /**
100             * Creates a new email address with the primary key. Does not add the email address to the database.
101             *
102             * @param emailAddressId the primary key for the new email address
103             * @return the new email address
104             */
105            @Override
106            public EmailAddress createEmailAddress(long emailAddressId) {
107                    return emailAddressPersistence.create(emailAddressId);
108            }
109    
110            /**
111             * Deletes the email address with the primary key from the database. Also notifies the appropriate model listeners.
112             *
113             * @param emailAddressId the primary key of the email address
114             * @return the email address that was removed
115             * @throws PortalException if a email address with the primary key could not be found
116             */
117            @Indexable(type = IndexableType.DELETE)
118            @Override
119            public EmailAddress deleteEmailAddress(long emailAddressId)
120                    throws PortalException {
121                    return emailAddressPersistence.remove(emailAddressId);
122            }
123    
124            /**
125             * Deletes the email address from the database. Also notifies the appropriate model listeners.
126             *
127             * @param emailAddress the email address
128             * @return the email address that was removed
129             */
130            @Indexable(type = IndexableType.DELETE)
131            @Override
132            public EmailAddress deleteEmailAddress(EmailAddress emailAddress) {
133                    return emailAddressPersistence.remove(emailAddress);
134            }
135    
136            @Override
137            public DynamicQuery dynamicQuery() {
138                    Class<?> clazz = getClass();
139    
140                    return DynamicQueryFactoryUtil.forClass(EmailAddress.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 emailAddressPersistence.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.EmailAddressModelImpl}. 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 emailAddressPersistence.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.EmailAddressModelImpl}. 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 emailAddressPersistence.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 emailAddressPersistence.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 emailAddressPersistence.countWithDynamicQuery(dynamicQuery,
216                            projection);
217            }
218    
219            @Override
220            public EmailAddress fetchEmailAddress(long emailAddressId) {
221                    return emailAddressPersistence.fetchByPrimaryKey(emailAddressId);
222            }
223    
224            /**
225             * Returns the email address with the matching UUID and company.
226             *
227             * @param uuid the email address's UUID
228             * @param companyId the primary key of the company
229             * @return the matching email address, or <code>null</code> if a matching email address could not be found
230             */
231            @Override
232            public EmailAddress fetchEmailAddressByUuidAndCompanyId(String uuid,
233                    long companyId) {
234                    return emailAddressPersistence.fetchByUuid_C_First(uuid, companyId, null);
235            }
236    
237            /**
238             * Returns the email address with the primary key.
239             *
240             * @param emailAddressId the primary key of the email address
241             * @return the email address
242             * @throws PortalException if a email address with the primary key could not be found
243             */
244            @Override
245            public EmailAddress getEmailAddress(long emailAddressId)
246                    throws PortalException {
247                    return emailAddressPersistence.findByPrimaryKey(emailAddressId);
248            }
249    
250            @Override
251            public ActionableDynamicQuery getActionableDynamicQuery() {
252                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
253    
254                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.EmailAddressLocalServiceUtil.getService());
255                    actionableDynamicQuery.setClassLoader(getClassLoader());
256                    actionableDynamicQuery.setModelClass(EmailAddress.class);
257    
258                    actionableDynamicQuery.setPrimaryKeyPropertyName("emailAddressId");
259    
260                    return actionableDynamicQuery;
261            }
262    
263            @Override
264            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
265                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
266    
267                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.EmailAddressLocalServiceUtil.getService());
268                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
269                    indexableActionableDynamicQuery.setModelClass(EmailAddress.class);
270    
271                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
272                            "emailAddressId");
273    
274                    return indexableActionableDynamicQuery;
275            }
276    
277            protected void initActionableDynamicQuery(
278                    ActionableDynamicQuery actionableDynamicQuery) {
279                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.EmailAddressLocalServiceUtil.getService());
280                    actionableDynamicQuery.setClassLoader(getClassLoader());
281                    actionableDynamicQuery.setModelClass(EmailAddress.class);
282    
283                    actionableDynamicQuery.setPrimaryKeyPropertyName("emailAddressId");
284            }
285    
286            @Override
287            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
288                    final PortletDataContext portletDataContext) {
289                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
290                                    @Override
291                                    public long performCount() throws PortalException {
292                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
293    
294                                            StagedModelType stagedModelType = getStagedModelType();
295    
296                                            long modelAdditionCount = super.performCount();
297    
298                                            manifestSummary.addModelAdditionCount(stagedModelType,
299                                                    modelAdditionCount);
300    
301                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
302                                                            stagedModelType);
303    
304                                            manifestSummary.addModelDeletionCount(stagedModelType,
305                                                    modelDeletionCount);
306    
307                                            return modelAdditionCount;
308                                    }
309                            };
310    
311                    initActionableDynamicQuery(exportActionableDynamicQuery);
312    
313                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
314                                    @Override
315                                    public void addCriteria(DynamicQuery dynamicQuery) {
316                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
317                                                    "modifiedDate");
318    
319                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
320    
321                                            long referrerClassNameId = stagedModelType.getReferrerClassNameId();
322    
323                                            Property classNameIdProperty = PropertyFactoryUtil.forName(
324                                                            "classNameId");
325    
326                                            if ((referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ALL) &&
327                                                            (referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ANY)) {
328                                                    dynamicQuery.add(classNameIdProperty.eq(
329                                                                    stagedModelType.getReferrerClassNameId()));
330                                            }
331                                            else if (referrerClassNameId == StagedModelType.REFERRER_CLASS_NAME_ID_ANY) {
332                                                    dynamicQuery.add(classNameIdProperty.isNotNull());
333                                            }
334                                    }
335                            });
336    
337                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
338    
339                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<EmailAddress>() {
340                                    @Override
341                                    public void performAction(EmailAddress emailAddress)
342                                            throws PortalException {
343                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
344                                                    emailAddress);
345                                    }
346                            });
347                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
348                                    PortalUtil.getClassNameId(EmailAddress.class.getName()),
349                                    StagedModelType.REFERRER_CLASS_NAME_ID_ALL));
350    
351                    return exportActionableDynamicQuery;
352            }
353    
354            /**
355             * @throws PortalException
356             */
357            @Override
358            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
359                    throws PortalException {
360                    return emailAddressLocalService.deleteEmailAddress((EmailAddress)persistedModel);
361            }
362    
363            @Override
364            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
365                    throws PortalException {
366                    return emailAddressPersistence.findByPrimaryKey(primaryKeyObj);
367            }
368    
369            /**
370             * Returns the email address with the matching UUID and company.
371             *
372             * @param uuid the email address's UUID
373             * @param companyId the primary key of the company
374             * @return the matching email address
375             * @throws PortalException if a matching email address could not be found
376             */
377            @Override
378            public EmailAddress getEmailAddressByUuidAndCompanyId(String uuid,
379                    long companyId) throws PortalException {
380                    return emailAddressPersistence.findByUuid_C_First(uuid, companyId, null);
381            }
382    
383            /**
384             * Returns a range of all the email addresses.
385             *
386             * <p>
387             * 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.EmailAddressModelImpl}. 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.
388             * </p>
389             *
390             * @param start the lower bound of the range of email addresses
391             * @param end the upper bound of the range of email addresses (not inclusive)
392             * @return the range of email addresses
393             */
394            @Override
395            public List<EmailAddress> getEmailAddresses(int start, int end) {
396                    return emailAddressPersistence.findAll(start, end);
397            }
398    
399            /**
400             * Returns the number of email addresses.
401             *
402             * @return the number of email addresses
403             */
404            @Override
405            public int getEmailAddressesCount() {
406                    return emailAddressPersistence.countAll();
407            }
408    
409            /**
410             * Updates the email address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
411             *
412             * @param emailAddress the email address
413             * @return the email address that was updated
414             */
415            @Indexable(type = IndexableType.REINDEX)
416            @Override
417            public EmailAddress updateEmailAddress(EmailAddress emailAddress) {
418                    return emailAddressPersistence.update(emailAddress);
419            }
420    
421            /**
422             * Returns the email address local service.
423             *
424             * @return the email address local service
425             */
426            public EmailAddressLocalService getEmailAddressLocalService() {
427                    return emailAddressLocalService;
428            }
429    
430            /**
431             * Sets the email address local service.
432             *
433             * @param emailAddressLocalService the email address local service
434             */
435            public void setEmailAddressLocalService(
436                    EmailAddressLocalService emailAddressLocalService) {
437                    this.emailAddressLocalService = emailAddressLocalService;
438            }
439    
440            /**
441             * Returns the email address persistence.
442             *
443             * @return the email address persistence
444             */
445            public EmailAddressPersistence getEmailAddressPersistence() {
446                    return emailAddressPersistence;
447            }
448    
449            /**
450             * Sets the email address persistence.
451             *
452             * @param emailAddressPersistence the email address persistence
453             */
454            public void setEmailAddressPersistence(
455                    EmailAddressPersistence emailAddressPersistence) {
456                    this.emailAddressPersistence = emailAddressPersistence;
457            }
458    
459            /**
460             * Returns the counter local service.
461             *
462             * @return the counter local service
463             */
464            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
465                    return counterLocalService;
466            }
467    
468            /**
469             * Sets the counter local service.
470             *
471             * @param counterLocalService the counter local service
472             */
473            public void setCounterLocalService(
474                    com.liferay.counter.service.CounterLocalService counterLocalService) {
475                    this.counterLocalService = counterLocalService;
476            }
477    
478            /**
479             * Returns the class name local service.
480             *
481             * @return the class name local service
482             */
483            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
484                    return classNameLocalService;
485            }
486    
487            /**
488             * Sets the class name local service.
489             *
490             * @param classNameLocalService the class name local service
491             */
492            public void setClassNameLocalService(
493                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
494                    this.classNameLocalService = classNameLocalService;
495            }
496    
497            /**
498             * Returns the class name persistence.
499             *
500             * @return the class name persistence
501             */
502            public ClassNamePersistence getClassNamePersistence() {
503                    return classNamePersistence;
504            }
505    
506            /**
507             * Sets the class name persistence.
508             *
509             * @param classNamePersistence the class name persistence
510             */
511            public void setClassNamePersistence(
512                    ClassNamePersistence classNamePersistence) {
513                    this.classNamePersistence = classNamePersistence;
514            }
515    
516            /**
517             * Returns the list type local service.
518             *
519             * @return the list type local service
520             */
521            public com.liferay.portal.service.ListTypeLocalService getListTypeLocalService() {
522                    return listTypeLocalService;
523            }
524    
525            /**
526             * Sets the list type local service.
527             *
528             * @param listTypeLocalService the list type local service
529             */
530            public void setListTypeLocalService(
531                    com.liferay.portal.service.ListTypeLocalService listTypeLocalService) {
532                    this.listTypeLocalService = listTypeLocalService;
533            }
534    
535            /**
536             * Returns the list type persistence.
537             *
538             * @return the list type persistence
539             */
540            public ListTypePersistence getListTypePersistence() {
541                    return listTypePersistence;
542            }
543    
544            /**
545             * Sets the list type persistence.
546             *
547             * @param listTypePersistence the list type persistence
548             */
549            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
550                    this.listTypePersistence = listTypePersistence;
551            }
552    
553            /**
554             * Returns the user local service.
555             *
556             * @return the user local service
557             */
558            public com.liferay.portal.service.UserLocalService getUserLocalService() {
559                    return userLocalService;
560            }
561    
562            /**
563             * Sets the user local service.
564             *
565             * @param userLocalService the user local service
566             */
567            public void setUserLocalService(
568                    com.liferay.portal.service.UserLocalService userLocalService) {
569                    this.userLocalService = userLocalService;
570            }
571    
572            /**
573             * Returns the user persistence.
574             *
575             * @return the user persistence
576             */
577            public UserPersistence getUserPersistence() {
578                    return userPersistence;
579            }
580    
581            /**
582             * Sets the user persistence.
583             *
584             * @param userPersistence the user persistence
585             */
586            public void setUserPersistence(UserPersistence userPersistence) {
587                    this.userPersistence = userPersistence;
588            }
589    
590            /**
591             * Returns the user finder.
592             *
593             * @return the user finder
594             */
595            public UserFinder getUserFinder() {
596                    return userFinder;
597            }
598    
599            /**
600             * Sets the user finder.
601             *
602             * @param userFinder the user finder
603             */
604            public void setUserFinder(UserFinder userFinder) {
605                    this.userFinder = userFinder;
606            }
607    
608            public void afterPropertiesSet() {
609                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.EmailAddress",
610                            emailAddressLocalService);
611            }
612    
613            public void destroy() {
614                    persistedModelLocalServiceRegistry.unregister(
615                            "com.liferay.portal.model.EmailAddress");
616            }
617    
618            /**
619             * Returns the OSGi service identifier.
620             *
621             * @return the OSGi service identifier
622             */
623            @Override
624            public String getOSGiServiceIdentifier() {
625                    return EmailAddressLocalService.class.getName();
626            }
627    
628            protected Class<?> getModelClass() {
629                    return EmailAddress.class;
630            }
631    
632            protected String getModelClassName() {
633                    return EmailAddress.class.getName();
634            }
635    
636            /**
637             * Performs a SQL query.
638             *
639             * @param sql the sql query
640             */
641            protected void runSQL(String sql) {
642                    try {
643                            DataSource dataSource = emailAddressPersistence.getDataSource();
644    
645                            DB db = DBManagerUtil.getDB();
646    
647                            sql = db.buildSQL(sql);
648                            sql = PortalUtil.transformSQL(sql);
649    
650                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
651                                            sql, new int[0]);
652    
653                            sqlUpdate.update();
654                    }
655                    catch (Exception e) {
656                            throw new SystemException(e);
657                    }
658            }
659    
660            @BeanReference(type = com.liferay.portal.service.EmailAddressLocalService.class)
661            protected EmailAddressLocalService emailAddressLocalService;
662            @BeanReference(type = EmailAddressPersistence.class)
663            protected EmailAddressPersistence emailAddressPersistence;
664            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
665            protected com.liferay.counter.service.CounterLocalService counterLocalService;
666            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
667            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
668            @BeanReference(type = ClassNamePersistence.class)
669            protected ClassNamePersistence classNamePersistence;
670            @BeanReference(type = com.liferay.portal.service.ListTypeLocalService.class)
671            protected com.liferay.portal.service.ListTypeLocalService listTypeLocalService;
672            @BeanReference(type = ListTypePersistence.class)
673            protected ListTypePersistence listTypePersistence;
674            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
675            protected com.liferay.portal.service.UserLocalService userLocalService;
676            @BeanReference(type = UserPersistence.class)
677            protected UserPersistence userPersistence;
678            @BeanReference(type = UserFinder.class)
679            protected UserFinder userFinder;
680            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
681            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
682    }