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