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 com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.dao.db.DB;
019    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.exception.SystemException;
023    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
024    import com.liferay.portal.model.EmailAddress;
025    import com.liferay.portal.service.BaseServiceImpl;
026    import com.liferay.portal.service.EmailAddressService;
027    import com.liferay.portal.service.persistence.ClassNamePersistence;
028    import com.liferay.portal.service.persistence.EmailAddressPersistence;
029    import com.liferay.portal.service.persistence.ListTypePersistence;
030    import com.liferay.portal.service.persistence.UserFinder;
031    import com.liferay.portal.service.persistence.UserPersistence;
032    import com.liferay.portal.util.PortalUtil;
033    
034    import javax.sql.DataSource;
035    
036    /**
037     * Provides the base implementation for the email address remote service.
038     *
039     * <p>
040     * 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.EmailAddressServiceImpl}.
041     * </p>
042     *
043     * @author Brian Wing Shun Chan
044     * @see com.liferay.portal.service.impl.EmailAddressServiceImpl
045     * @see com.liferay.portal.service.EmailAddressServiceUtil
046     * @generated
047     */
048    public abstract class EmailAddressServiceBaseImpl extends BaseServiceImpl
049            implements EmailAddressService, IdentifiableOSGiService {
050            /*
051             * NOTE FOR DEVELOPERS:
052             *
053             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.EmailAddressServiceUtil} to access the email address remote service.
054             */
055    
056            /**
057             * Returns the email address local service.
058             *
059             * @return the email address local service
060             */
061            public com.liferay.portal.service.EmailAddressLocalService getEmailAddressLocalService() {
062                    return emailAddressLocalService;
063            }
064    
065            /**
066             * Sets the email address local service.
067             *
068             * @param emailAddressLocalService the email address local service
069             */
070            public void setEmailAddressLocalService(
071                    com.liferay.portal.service.EmailAddressLocalService emailAddressLocalService) {
072                    this.emailAddressLocalService = emailAddressLocalService;
073            }
074    
075            /**
076             * Returns the email address remote service.
077             *
078             * @return the email address remote service
079             */
080            public EmailAddressService getEmailAddressService() {
081                    return emailAddressService;
082            }
083    
084            /**
085             * Sets the email address remote service.
086             *
087             * @param emailAddressService the email address remote service
088             */
089            public void setEmailAddressService(EmailAddressService emailAddressService) {
090                    this.emailAddressService = emailAddressService;
091            }
092    
093            /**
094             * Returns the email address persistence.
095             *
096             * @return the email address persistence
097             */
098            public EmailAddressPersistence getEmailAddressPersistence() {
099                    return emailAddressPersistence;
100            }
101    
102            /**
103             * Sets the email address persistence.
104             *
105             * @param emailAddressPersistence the email address persistence
106             */
107            public void setEmailAddressPersistence(
108                    EmailAddressPersistence emailAddressPersistence) {
109                    this.emailAddressPersistence = emailAddressPersistence;
110            }
111    
112            /**
113             * Returns the counter local service.
114             *
115             * @return the counter local service
116             */
117            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
118                    return counterLocalService;
119            }
120    
121            /**
122             * Sets the counter local service.
123             *
124             * @param counterLocalService the counter local service
125             */
126            public void setCounterLocalService(
127                    com.liferay.counter.service.CounterLocalService counterLocalService) {
128                    this.counterLocalService = counterLocalService;
129            }
130    
131            /**
132             * Returns the class name local service.
133             *
134             * @return the class name local service
135             */
136            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
137                    return classNameLocalService;
138            }
139    
140            /**
141             * Sets the class name local service.
142             *
143             * @param classNameLocalService the class name local service
144             */
145            public void setClassNameLocalService(
146                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
147                    this.classNameLocalService = classNameLocalService;
148            }
149    
150            /**
151             * Returns the class name remote service.
152             *
153             * @return the class name remote service
154             */
155            public com.liferay.portal.service.ClassNameService getClassNameService() {
156                    return classNameService;
157            }
158    
159            /**
160             * Sets the class name remote service.
161             *
162             * @param classNameService the class name remote service
163             */
164            public void setClassNameService(
165                    com.liferay.portal.service.ClassNameService classNameService) {
166                    this.classNameService = classNameService;
167            }
168    
169            /**
170             * Returns the class name persistence.
171             *
172             * @return the class name persistence
173             */
174            public ClassNamePersistence getClassNamePersistence() {
175                    return classNamePersistence;
176            }
177    
178            /**
179             * Sets the class name persistence.
180             *
181             * @param classNamePersistence the class name persistence
182             */
183            public void setClassNamePersistence(
184                    ClassNamePersistence classNamePersistence) {
185                    this.classNamePersistence = classNamePersistence;
186            }
187    
188            /**
189             * Returns the list type local service.
190             *
191             * @return the list type local service
192             */
193            public com.liferay.portal.service.ListTypeLocalService getListTypeLocalService() {
194                    return listTypeLocalService;
195            }
196    
197            /**
198             * Sets the list type local service.
199             *
200             * @param listTypeLocalService the list type local service
201             */
202            public void setListTypeLocalService(
203                    com.liferay.portal.service.ListTypeLocalService listTypeLocalService) {
204                    this.listTypeLocalService = listTypeLocalService;
205            }
206    
207            /**
208             * Returns the list type remote service.
209             *
210             * @return the list type remote service
211             */
212            public com.liferay.portal.service.ListTypeService getListTypeService() {
213                    return listTypeService;
214            }
215    
216            /**
217             * Sets the list type remote service.
218             *
219             * @param listTypeService the list type remote service
220             */
221            public void setListTypeService(
222                    com.liferay.portal.service.ListTypeService listTypeService) {
223                    this.listTypeService = listTypeService;
224            }
225    
226            /**
227             * Returns the list type persistence.
228             *
229             * @return the list type persistence
230             */
231            public ListTypePersistence getListTypePersistence() {
232                    return listTypePersistence;
233            }
234    
235            /**
236             * Sets the list type persistence.
237             *
238             * @param listTypePersistence the list type persistence
239             */
240            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
241                    this.listTypePersistence = listTypePersistence;
242            }
243    
244            /**
245             * Returns the user local service.
246             *
247             * @return the user local service
248             */
249            public com.liferay.portal.service.UserLocalService getUserLocalService() {
250                    return userLocalService;
251            }
252    
253            /**
254             * Sets the user local service.
255             *
256             * @param userLocalService the user local service
257             */
258            public void setUserLocalService(
259                    com.liferay.portal.service.UserLocalService userLocalService) {
260                    this.userLocalService = userLocalService;
261            }
262    
263            /**
264             * Returns the user remote service.
265             *
266             * @return the user remote service
267             */
268            public com.liferay.portal.service.UserService getUserService() {
269                    return userService;
270            }
271    
272            /**
273             * Sets the user remote service.
274             *
275             * @param userService the user remote service
276             */
277            public void setUserService(
278                    com.liferay.portal.service.UserService userService) {
279                    this.userService = userService;
280            }
281    
282            /**
283             * Returns the user persistence.
284             *
285             * @return the user persistence
286             */
287            public UserPersistence getUserPersistence() {
288                    return userPersistence;
289            }
290    
291            /**
292             * Sets the user persistence.
293             *
294             * @param userPersistence the user persistence
295             */
296            public void setUserPersistence(UserPersistence userPersistence) {
297                    this.userPersistence = userPersistence;
298            }
299    
300            /**
301             * Returns the user finder.
302             *
303             * @return the user finder
304             */
305            public UserFinder getUserFinder() {
306                    return userFinder;
307            }
308    
309            /**
310             * Sets the user finder.
311             *
312             * @param userFinder the user finder
313             */
314            public void setUserFinder(UserFinder userFinder) {
315                    this.userFinder = userFinder;
316            }
317    
318            public void afterPropertiesSet() {
319            }
320    
321            public void destroy() {
322            }
323    
324            /**
325             * Returns the OSGi service identifier.
326             *
327             * @return the OSGi service identifier
328             */
329            @Override
330            public String getOSGiServiceIdentifier() {
331                    return EmailAddressService.class.getName();
332            }
333    
334            protected Class<?> getModelClass() {
335                    return EmailAddress.class;
336            }
337    
338            protected String getModelClassName() {
339                    return EmailAddress.class.getName();
340            }
341    
342            /**
343             * Performs a SQL query.
344             *
345             * @param sql the sql query
346             */
347            protected void runSQL(String sql) {
348                    try {
349                            DataSource dataSource = emailAddressPersistence.getDataSource();
350    
351                            DB db = DBManagerUtil.getDB();
352    
353                            sql = db.buildSQL(sql);
354                            sql = PortalUtil.transformSQL(sql);
355    
356                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
357                                            sql, new int[0]);
358    
359                            sqlUpdate.update();
360                    }
361                    catch (Exception e) {
362                            throw new SystemException(e);
363                    }
364            }
365    
366            @BeanReference(type = com.liferay.portal.service.EmailAddressLocalService.class)
367            protected com.liferay.portal.service.EmailAddressLocalService emailAddressLocalService;
368            @BeanReference(type = com.liferay.portal.service.EmailAddressService.class)
369            protected EmailAddressService emailAddressService;
370            @BeanReference(type = EmailAddressPersistence.class)
371            protected EmailAddressPersistence emailAddressPersistence;
372            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
373            protected com.liferay.counter.service.CounterLocalService counterLocalService;
374            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
375            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
376            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
377            protected com.liferay.portal.service.ClassNameService classNameService;
378            @BeanReference(type = ClassNamePersistence.class)
379            protected ClassNamePersistence classNamePersistence;
380            @BeanReference(type = com.liferay.portal.service.ListTypeLocalService.class)
381            protected com.liferay.portal.service.ListTypeLocalService listTypeLocalService;
382            @BeanReference(type = com.liferay.portal.service.ListTypeService.class)
383            protected com.liferay.portal.service.ListTypeService listTypeService;
384            @BeanReference(type = ListTypePersistence.class)
385            protected ListTypePersistence listTypePersistence;
386            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
387            protected com.liferay.portal.service.UserLocalService userLocalService;
388            @BeanReference(type = com.liferay.portal.service.UserService.class)
389            protected com.liferay.portal.service.UserService userService;
390            @BeanReference(type = UserPersistence.class)
391            protected UserPersistence userPersistence;
392            @BeanReference(type = UserFinder.class)
393            protected UserFinder userFinder;
394    }