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.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, IdentifiableOSGiService {
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 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(AddressService addressService) {
091                    this.addressService = addressService;
092            }
093    
094            /**
095             * Returns the address persistence.
096             *
097             * @return the address persistence
098             */
099            public AddressPersistence getAddressPersistence() {
100                    return addressPersistence;
101            }
102    
103            /**
104             * Sets the address persistence.
105             *
106             * @param addressPersistence the address persistence
107             */
108            public void setAddressPersistence(AddressPersistence addressPersistence) {
109                    this.addressPersistence = addressPersistence;
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 country remote service.
190             *
191             * @return the country remote service
192             */
193            public com.liferay.portal.service.CountryService getCountryService() {
194                    return countryService;
195            }
196    
197            /**
198             * Sets the country remote service.
199             *
200             * @param countryService the country remote service
201             */
202            public void setCountryService(
203                    com.liferay.portal.service.CountryService countryService) {
204                    this.countryService = countryService;
205            }
206    
207            /**
208             * Returns the country persistence.
209             *
210             * @return the country persistence
211             */
212            public CountryPersistence getCountryPersistence() {
213                    return countryPersistence;
214            }
215    
216            /**
217             * Sets the country persistence.
218             *
219             * @param countryPersistence the country persistence
220             */
221            public void setCountryPersistence(CountryPersistence countryPersistence) {
222                    this.countryPersistence = countryPersistence;
223            }
224    
225            /**
226             * Returns the list type local service.
227             *
228             * @return the list type local service
229             */
230            public com.liferay.portal.service.ListTypeLocalService getListTypeLocalService() {
231                    return listTypeLocalService;
232            }
233    
234            /**
235             * Sets the list type local service.
236             *
237             * @param listTypeLocalService the list type local service
238             */
239            public void setListTypeLocalService(
240                    com.liferay.portal.service.ListTypeLocalService listTypeLocalService) {
241                    this.listTypeLocalService = listTypeLocalService;
242            }
243    
244            /**
245             * Returns the list type remote service.
246             *
247             * @return the list type remote service
248             */
249            public com.liferay.portal.service.ListTypeService getListTypeService() {
250                    return listTypeService;
251            }
252    
253            /**
254             * Sets the list type remote service.
255             *
256             * @param listTypeService the list type remote service
257             */
258            public void setListTypeService(
259                    com.liferay.portal.service.ListTypeService listTypeService) {
260                    this.listTypeService = listTypeService;
261            }
262    
263            /**
264             * Returns the list type persistence.
265             *
266             * @return the list type persistence
267             */
268            public ListTypePersistence getListTypePersistence() {
269                    return listTypePersistence;
270            }
271    
272            /**
273             * Sets the list type persistence.
274             *
275             * @param listTypePersistence the list type persistence
276             */
277            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
278                    this.listTypePersistence = listTypePersistence;
279            }
280    
281            /**
282             * Returns the user local service.
283             *
284             * @return the user local service
285             */
286            public com.liferay.portal.service.UserLocalService getUserLocalService() {
287                    return userLocalService;
288            }
289    
290            /**
291             * Sets the user local service.
292             *
293             * @param userLocalService the user local service
294             */
295            public void setUserLocalService(
296                    com.liferay.portal.service.UserLocalService userLocalService) {
297                    this.userLocalService = userLocalService;
298            }
299    
300            /**
301             * Returns the user remote service.
302             *
303             * @return the user remote service
304             */
305            public com.liferay.portal.service.UserService getUserService() {
306                    return userService;
307            }
308    
309            /**
310             * Sets the user remote service.
311             *
312             * @param userService the user remote service
313             */
314            public void setUserService(
315                    com.liferay.portal.service.UserService userService) {
316                    this.userService = userService;
317            }
318    
319            /**
320             * Returns the user persistence.
321             *
322             * @return the user persistence
323             */
324            public UserPersistence getUserPersistence() {
325                    return userPersistence;
326            }
327    
328            /**
329             * Sets the user persistence.
330             *
331             * @param userPersistence the user persistence
332             */
333            public void setUserPersistence(UserPersistence userPersistence) {
334                    this.userPersistence = userPersistence;
335            }
336    
337            /**
338             * Returns the user finder.
339             *
340             * @return the user finder
341             */
342            public UserFinder getUserFinder() {
343                    return userFinder;
344            }
345    
346            /**
347             * Sets the user finder.
348             *
349             * @param userFinder the user finder
350             */
351            public void setUserFinder(UserFinder userFinder) {
352                    this.userFinder = userFinder;
353            }
354    
355            public void afterPropertiesSet() {
356            }
357    
358            public void destroy() {
359            }
360    
361            /**
362             * Returns the OSGi service identifier.
363             *
364             * @return the OSGi service identifier
365             */
366            @Override
367            public String getOSGiServiceIdentifier() {
368                    return AddressService.class.getName();
369            }
370    
371            protected Class<?> getModelClass() {
372                    return Address.class;
373            }
374    
375            protected String getModelClassName() {
376                    return Address.class.getName();
377            }
378    
379            /**
380             * Performs a SQL query.
381             *
382             * @param sql the sql query
383             */
384            protected void runSQL(String sql) {
385                    try {
386                            DataSource dataSource = addressPersistence.getDataSource();
387    
388                            DB db = DBManagerUtil.getDB();
389    
390                            sql = db.buildSQL(sql);
391                            sql = PortalUtil.transformSQL(sql);
392    
393                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
394                                            sql, new int[0]);
395    
396                            sqlUpdate.update();
397                    }
398                    catch (Exception e) {
399                            throw new SystemException(e);
400                    }
401            }
402    
403            @BeanReference(type = com.liferay.portal.service.AddressLocalService.class)
404            protected com.liferay.portal.service.AddressLocalService addressLocalService;
405            @BeanReference(type = com.liferay.portal.service.AddressService.class)
406            protected AddressService addressService;
407            @BeanReference(type = AddressPersistence.class)
408            protected AddressPersistence addressPersistence;
409            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
410            protected com.liferay.counter.service.CounterLocalService counterLocalService;
411            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
412            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
413            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
414            protected com.liferay.portal.service.ClassNameService classNameService;
415            @BeanReference(type = ClassNamePersistence.class)
416            protected ClassNamePersistence classNamePersistence;
417            @BeanReference(type = com.liferay.portal.service.CountryService.class)
418            protected com.liferay.portal.service.CountryService countryService;
419            @BeanReference(type = CountryPersistence.class)
420            protected CountryPersistence countryPersistence;
421            @BeanReference(type = com.liferay.portal.service.ListTypeLocalService.class)
422            protected com.liferay.portal.service.ListTypeLocalService listTypeLocalService;
423            @BeanReference(type = com.liferay.portal.service.ListTypeService.class)
424            protected com.liferay.portal.service.ListTypeService listTypeService;
425            @BeanReference(type = ListTypePersistence.class)
426            protected ListTypePersistence listTypePersistence;
427            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
428            protected com.liferay.portal.service.UserLocalService userLocalService;
429            @BeanReference(type = com.liferay.portal.service.UserService.class)
430            protected com.liferay.portal.service.UserService userService;
431            @BeanReference(type = UserPersistence.class)
432            protected UserPersistence userPersistence;
433            @BeanReference(type = UserFinder.class)
434            protected UserFinder userFinder;
435    }