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.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.search.Indexable;
036    import com.liferay.portal.kernel.search.IndexableType;
037    import com.liferay.portal.kernel.util.OrderByComparator;
038    import com.liferay.portal.model.Address;
039    import com.liferay.portal.model.PersistedModel;
040    import com.liferay.portal.service.AddressLocalService;
041    import com.liferay.portal.service.BaseLocalServiceImpl;
042    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
043    import com.liferay.portal.service.persistence.AddressPersistence;
044    import com.liferay.portal.service.persistence.ClassNamePersistence;
045    import com.liferay.portal.service.persistence.CountryPersistence;
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 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.AddressLocalServiceImpl}.
068     * </p>
069     *
070     * @author Brian Wing Shun Chan
071     * @see com.liferay.portal.service.impl.AddressLocalServiceImpl
072     * @see com.liferay.portal.service.AddressLocalServiceUtil
073     * @generated
074     */
075    @ProviderType
076    public abstract class AddressLocalServiceBaseImpl extends BaseLocalServiceImpl
077            implements AddressLocalService, IdentifiableBean {
078            /*
079             * NOTE FOR DEVELOPERS:
080             *
081             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.AddressLocalServiceUtil} to access the address local service.
082             */
083    
084            /**
085             * Adds the address to the database. Also notifies the appropriate model listeners.
086             *
087             * @param address the address
088             * @return the address that was added
089             */
090            @Indexable(type = IndexableType.REINDEX)
091            @Override
092            public Address addAddress(Address address) {
093                    address.setNew(true);
094    
095                    return addressPersistence.update(address);
096            }
097    
098            /**
099             * Creates a new address with the primary key. Does not add the address to the database.
100             *
101             * @param addressId the primary key for the new address
102             * @return the new address
103             */
104            @Override
105            public Address createAddress(long addressId) {
106                    return addressPersistence.create(addressId);
107            }
108    
109            /**
110             * Deletes the address with the primary key from the database. Also notifies the appropriate model listeners.
111             *
112             * @param addressId the primary key of the address
113             * @return the address that was removed
114             * @throws PortalException if a address with the primary key could not be found
115             */
116            @Indexable(type = IndexableType.DELETE)
117            @Override
118            public Address deleteAddress(long addressId) throws PortalException {
119                    return addressPersistence.remove(addressId);
120            }
121    
122            /**
123             * Deletes the address from the database. Also notifies the appropriate model listeners.
124             *
125             * @param address the address
126             * @return the address that was removed
127             */
128            @Indexable(type = IndexableType.DELETE)
129            @Override
130            public Address deleteAddress(Address address) {
131                    return addressPersistence.remove(address);
132            }
133    
134            @Override
135            public DynamicQuery dynamicQuery() {
136                    Class<?> clazz = getClass();
137    
138                    return DynamicQueryFactoryUtil.forClass(Address.class,
139                            clazz.getClassLoader());
140            }
141    
142            /**
143             * Performs a dynamic query on the database and returns the matching rows.
144             *
145             * @param dynamicQuery the dynamic query
146             * @return the matching rows
147             */
148            @Override
149            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
150                    return addressPersistence.findWithDynamicQuery(dynamicQuery);
151            }
152    
153            /**
154             * Performs a dynamic query on the database and returns a range of the matching rows.
155             *
156             * <p>
157             * 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.AddressModelImpl}. 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.
158             * </p>
159             *
160             * @param dynamicQuery the dynamic query
161             * @param start the lower bound of the range of model instances
162             * @param end the upper bound of the range of model instances (not inclusive)
163             * @return the range of matching rows
164             */
165            @Override
166            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
167                    int end) {
168                    return addressPersistence.findWithDynamicQuery(dynamicQuery, start, end);
169            }
170    
171            /**
172             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
173             *
174             * <p>
175             * 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.AddressModelImpl}. 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.
176             * </p>
177             *
178             * @param dynamicQuery the dynamic query
179             * @param start the lower bound of the range of model instances
180             * @param end the upper bound of the range of model instances (not inclusive)
181             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
182             * @return the ordered range of matching rows
183             */
184            @Override
185            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
186                    int end, OrderByComparator<T> orderByComparator) {
187                    return addressPersistence.findWithDynamicQuery(dynamicQuery, start,
188                            end, orderByComparator);
189            }
190    
191            /**
192             * Returns the number of rows matching the dynamic query.
193             *
194             * @param dynamicQuery the dynamic query
195             * @return the number of rows matching the dynamic query
196             */
197            @Override
198            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
199                    return addressPersistence.countWithDynamicQuery(dynamicQuery);
200            }
201    
202            /**
203             * Returns the number of rows matching the dynamic query.
204             *
205             * @param dynamicQuery the dynamic query
206             * @param projection the projection to apply to the query
207             * @return the number of rows matching the dynamic query
208             */
209            @Override
210            public long dynamicQueryCount(DynamicQuery dynamicQuery,
211                    Projection projection) {
212                    return addressPersistence.countWithDynamicQuery(dynamicQuery, projection);
213            }
214    
215            @Override
216            public Address fetchAddress(long addressId) {
217                    return addressPersistence.fetchByPrimaryKey(addressId);
218            }
219    
220            /**
221             * Returns the address with the matching UUID and company.
222             *
223             * @param uuid the address's UUID
224             * @param companyId the primary key of the company
225             * @return the matching address, or <code>null</code> if a matching address could not be found
226             */
227            @Override
228            public Address fetchAddressByUuidAndCompanyId(String uuid, long companyId) {
229                    return addressPersistence.fetchByUuid_C_First(uuid, companyId, null);
230            }
231    
232            /**
233             * Returns the address with the primary key.
234             *
235             * @param addressId the primary key of the address
236             * @return the address
237             * @throws PortalException if a address with the primary key could not be found
238             */
239            @Override
240            public Address getAddress(long addressId) throws PortalException {
241                    return addressPersistence.findByPrimaryKey(addressId);
242            }
243    
244            @Override
245            public ActionableDynamicQuery getActionableDynamicQuery() {
246                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
247    
248                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.AddressLocalServiceUtil.getService());
249                    actionableDynamicQuery.setClass(Address.class);
250                    actionableDynamicQuery.setClassLoader(getClassLoader());
251    
252                    actionableDynamicQuery.setPrimaryKeyPropertyName("addressId");
253    
254                    return actionableDynamicQuery;
255            }
256    
257            protected void initActionableDynamicQuery(
258                    ActionableDynamicQuery actionableDynamicQuery) {
259                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.AddressLocalServiceUtil.getService());
260                    actionableDynamicQuery.setClass(Address.class);
261                    actionableDynamicQuery.setClassLoader(getClassLoader());
262    
263                    actionableDynamicQuery.setPrimaryKeyPropertyName("addressId");
264            }
265    
266            @Override
267            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
268                    final PortletDataContext portletDataContext) {
269                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
270                                    @Override
271                                    public long performCount() throws PortalException {
272                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
273    
274                                            StagedModelType stagedModelType = getStagedModelType();
275    
276                                            long modelAdditionCount = super.performCount();
277    
278                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
279                                                    modelAdditionCount);
280    
281                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
282                                                            stagedModelType);
283    
284                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
285                                                    modelDeletionCount);
286    
287                                            return modelAdditionCount;
288                                    }
289                            };
290    
291                    initActionableDynamicQuery(exportActionableDynamicQuery);
292    
293                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
294                                    @Override
295                                    public void addCriteria(DynamicQuery dynamicQuery) {
296                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
297                                                    "modifiedDate");
298    
299                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
300    
301                                            if (stagedModelType.getReferrerClassNameId() >= 0) {
302                                                    Property classNameIdProperty = PropertyFactoryUtil.forName(
303                                                                    "classNameId");
304    
305                                                    dynamicQuery.add(classNameIdProperty.eq(
306                                                                    stagedModelType.getReferrerClassNameId()));
307                                            }
308                                    }
309                            });
310    
311                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
312    
313                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
314                                    @Override
315                                    public void performAction(Object object)
316                                            throws PortalException {
317                                            Address stagedModel = (Address)object;
318    
319                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
320                                                    stagedModel);
321                                    }
322                            });
323                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
324                                    PortalUtil.getClassNameId(Address.class.getName())));
325    
326                    return exportActionableDynamicQuery;
327            }
328    
329            /**
330             * @throws PortalException
331             */
332            @Override
333            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
334                    throws PortalException {
335                    return addressLocalService.deleteAddress((Address)persistedModel);
336            }
337    
338            @Override
339            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
340                    throws PortalException {
341                    return addressPersistence.findByPrimaryKey(primaryKeyObj);
342            }
343    
344            /**
345             * Returns the address with the matching UUID and company.
346             *
347             * @param uuid the address's UUID
348             * @param companyId the primary key of the company
349             * @return the matching address
350             * @throws PortalException if a matching address could not be found
351             */
352            @Override
353            public Address getAddressByUuidAndCompanyId(String uuid, long companyId)
354                    throws PortalException {
355                    return addressPersistence.findByUuid_C_First(uuid, companyId, null);
356            }
357    
358            /**
359             * Returns a range of all the addresses.
360             *
361             * <p>
362             * 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.AddressModelImpl}. 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.
363             * </p>
364             *
365             * @param start the lower bound of the range of addresses
366             * @param end the upper bound of the range of addresses (not inclusive)
367             * @return the range of addresses
368             */
369            @Override
370            public List<Address> getAddresses(int start, int end) {
371                    return addressPersistence.findAll(start, end);
372            }
373    
374            /**
375             * Returns the number of addresses.
376             *
377             * @return the number of addresses
378             */
379            @Override
380            public int getAddressesCount() {
381                    return addressPersistence.countAll();
382            }
383    
384            /**
385             * Updates the address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
386             *
387             * @param address the address
388             * @return the address that was updated
389             */
390            @Indexable(type = IndexableType.REINDEX)
391            @Override
392            public Address updateAddress(Address address) {
393                    return addressPersistence.update(address);
394            }
395    
396            /**
397             * Returns the address local service.
398             *
399             * @return the address local service
400             */
401            public AddressLocalService getAddressLocalService() {
402                    return addressLocalService;
403            }
404    
405            /**
406             * Sets the address local service.
407             *
408             * @param addressLocalService the address local service
409             */
410            public void setAddressLocalService(AddressLocalService addressLocalService) {
411                    this.addressLocalService = addressLocalService;
412            }
413    
414            /**
415             * Returns the address remote service.
416             *
417             * @return the address remote service
418             */
419            public com.liferay.portal.service.AddressService getAddressService() {
420                    return addressService;
421            }
422    
423            /**
424             * Sets the address remote service.
425             *
426             * @param addressService the address remote service
427             */
428            public void setAddressService(
429                    com.liferay.portal.service.AddressService addressService) {
430                    this.addressService = addressService;
431            }
432    
433            /**
434             * Returns the address persistence.
435             *
436             * @return the address persistence
437             */
438            public AddressPersistence getAddressPersistence() {
439                    return addressPersistence;
440            }
441    
442            /**
443             * Sets the address persistence.
444             *
445             * @param addressPersistence the address persistence
446             */
447            public void setAddressPersistence(AddressPersistence addressPersistence) {
448                    this.addressPersistence = addressPersistence;
449            }
450    
451            /**
452             * Returns the counter local service.
453             *
454             * @return the counter local service
455             */
456            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
457                    return counterLocalService;
458            }
459    
460            /**
461             * Sets the counter local service.
462             *
463             * @param counterLocalService the counter local service
464             */
465            public void setCounterLocalService(
466                    com.liferay.counter.service.CounterLocalService counterLocalService) {
467                    this.counterLocalService = counterLocalService;
468            }
469    
470            /**
471             * Returns the class name local service.
472             *
473             * @return the class name local service
474             */
475            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
476                    return classNameLocalService;
477            }
478    
479            /**
480             * Sets the class name local service.
481             *
482             * @param classNameLocalService the class name local service
483             */
484            public void setClassNameLocalService(
485                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
486                    this.classNameLocalService = classNameLocalService;
487            }
488    
489            /**
490             * Returns the class name remote service.
491             *
492             * @return the class name remote service
493             */
494            public com.liferay.portal.service.ClassNameService getClassNameService() {
495                    return classNameService;
496            }
497    
498            /**
499             * Sets the class name remote service.
500             *
501             * @param classNameService the class name remote service
502             */
503            public void setClassNameService(
504                    com.liferay.portal.service.ClassNameService classNameService) {
505                    this.classNameService = classNameService;
506            }
507    
508            /**
509             * Returns the class name persistence.
510             *
511             * @return the class name persistence
512             */
513            public ClassNamePersistence getClassNamePersistence() {
514                    return classNamePersistence;
515            }
516    
517            /**
518             * Sets the class name persistence.
519             *
520             * @param classNamePersistence the class name persistence
521             */
522            public void setClassNamePersistence(
523                    ClassNamePersistence classNamePersistence) {
524                    this.classNamePersistence = classNamePersistence;
525            }
526    
527            /**
528             * Returns the country remote service.
529             *
530             * @return the country remote service
531             */
532            public com.liferay.portal.service.CountryService getCountryService() {
533                    return countryService;
534            }
535    
536            /**
537             * Sets the country remote service.
538             *
539             * @param countryService the country remote service
540             */
541            public void setCountryService(
542                    com.liferay.portal.service.CountryService countryService) {
543                    this.countryService = countryService;
544            }
545    
546            /**
547             * Returns the country persistence.
548             *
549             * @return the country persistence
550             */
551            public CountryPersistence getCountryPersistence() {
552                    return countryPersistence;
553            }
554    
555            /**
556             * Sets the country persistence.
557             *
558             * @param countryPersistence the country persistence
559             */
560            public void setCountryPersistence(CountryPersistence countryPersistence) {
561                    this.countryPersistence = countryPersistence;
562            }
563    
564            /**
565             * Returns the list type local service.
566             *
567             * @return the list type local service
568             */
569            public com.liferay.portal.service.ListTypeLocalService getListTypeLocalService() {
570                    return listTypeLocalService;
571            }
572    
573            /**
574             * Sets the list type local service.
575             *
576             * @param listTypeLocalService the list type local service
577             */
578            public void setListTypeLocalService(
579                    com.liferay.portal.service.ListTypeLocalService listTypeLocalService) {
580                    this.listTypeLocalService = listTypeLocalService;
581            }
582    
583            /**
584             * Returns the list type remote service.
585             *
586             * @return the list type remote service
587             */
588            public com.liferay.portal.service.ListTypeService getListTypeService() {
589                    return listTypeService;
590            }
591    
592            /**
593             * Sets the list type remote service.
594             *
595             * @param listTypeService the list type remote service
596             */
597            public void setListTypeService(
598                    com.liferay.portal.service.ListTypeService listTypeService) {
599                    this.listTypeService = listTypeService;
600            }
601    
602            /**
603             * Returns the list type persistence.
604             *
605             * @return the list type persistence
606             */
607            public ListTypePersistence getListTypePersistence() {
608                    return listTypePersistence;
609            }
610    
611            /**
612             * Sets the list type persistence.
613             *
614             * @param listTypePersistence the list type persistence
615             */
616            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
617                    this.listTypePersistence = listTypePersistence;
618            }
619    
620            /**
621             * Returns the user local service.
622             *
623             * @return the user local service
624             */
625            public com.liferay.portal.service.UserLocalService getUserLocalService() {
626                    return userLocalService;
627            }
628    
629            /**
630             * Sets the user local service.
631             *
632             * @param userLocalService the user local service
633             */
634            public void setUserLocalService(
635                    com.liferay.portal.service.UserLocalService userLocalService) {
636                    this.userLocalService = userLocalService;
637            }
638    
639            /**
640             * Returns the user remote service.
641             *
642             * @return the user remote service
643             */
644            public com.liferay.portal.service.UserService getUserService() {
645                    return userService;
646            }
647    
648            /**
649             * Sets the user remote service.
650             *
651             * @param userService the user remote service
652             */
653            public void setUserService(
654                    com.liferay.portal.service.UserService userService) {
655                    this.userService = userService;
656            }
657    
658            /**
659             * Returns the user persistence.
660             *
661             * @return the user persistence
662             */
663            public UserPersistence getUserPersistence() {
664                    return userPersistence;
665            }
666    
667            /**
668             * Sets the user persistence.
669             *
670             * @param userPersistence the user persistence
671             */
672            public void setUserPersistence(UserPersistence userPersistence) {
673                    this.userPersistence = userPersistence;
674            }
675    
676            /**
677             * Returns the user finder.
678             *
679             * @return the user finder
680             */
681            public UserFinder getUserFinder() {
682                    return userFinder;
683            }
684    
685            /**
686             * Sets the user finder.
687             *
688             * @param userFinder the user finder
689             */
690            public void setUserFinder(UserFinder userFinder) {
691                    this.userFinder = userFinder;
692            }
693    
694            public void afterPropertiesSet() {
695                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Address",
696                            addressLocalService);
697            }
698    
699            public void destroy() {
700                    persistedModelLocalServiceRegistry.unregister(
701                            "com.liferay.portal.model.Address");
702            }
703    
704            /**
705             * Returns the Spring bean ID for this bean.
706             *
707             * @return the Spring bean ID for this bean
708             */
709            @Override
710            public String getBeanIdentifier() {
711                    return _beanIdentifier;
712            }
713    
714            /**
715             * Sets the Spring bean ID for this bean.
716             *
717             * @param beanIdentifier the Spring bean ID for this bean
718             */
719            @Override
720            public void setBeanIdentifier(String beanIdentifier) {
721                    _beanIdentifier = beanIdentifier;
722            }
723    
724            protected Class<?> getModelClass() {
725                    return Address.class;
726            }
727    
728            protected String getModelClassName() {
729                    return Address.class.getName();
730            }
731    
732            /**
733             * Performs a SQL query.
734             *
735             * @param sql the sql query
736             */
737            protected void runSQL(String sql) {
738                    try {
739                            DataSource dataSource = addressPersistence.getDataSource();
740    
741                            DB db = DBFactoryUtil.getDB();
742    
743                            sql = db.buildSQL(sql);
744                            sql = PortalUtil.transformSQL(sql);
745    
746                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
747                                            sql, new int[0]);
748    
749                            sqlUpdate.update();
750                    }
751                    catch (Exception e) {
752                            throw new SystemException(e);
753                    }
754            }
755    
756            @BeanReference(type = AddressLocalService.class)
757            protected AddressLocalService addressLocalService;
758            @BeanReference(type = com.liferay.portal.service.AddressService.class)
759            protected com.liferay.portal.service.AddressService addressService;
760            @BeanReference(type = AddressPersistence.class)
761            protected AddressPersistence addressPersistence;
762            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
763            protected com.liferay.counter.service.CounterLocalService counterLocalService;
764            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
765            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
766            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
767            protected com.liferay.portal.service.ClassNameService classNameService;
768            @BeanReference(type = ClassNamePersistence.class)
769            protected ClassNamePersistence classNamePersistence;
770            @BeanReference(type = com.liferay.portal.service.CountryService.class)
771            protected com.liferay.portal.service.CountryService countryService;
772            @BeanReference(type = CountryPersistence.class)
773            protected CountryPersistence countryPersistence;
774            @BeanReference(type = com.liferay.portal.service.ListTypeLocalService.class)
775            protected com.liferay.portal.service.ListTypeLocalService listTypeLocalService;
776            @BeanReference(type = com.liferay.portal.service.ListTypeService.class)
777            protected com.liferay.portal.service.ListTypeService listTypeService;
778            @BeanReference(type = ListTypePersistence.class)
779            protected ListTypePersistence listTypePersistence;
780            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
781            protected com.liferay.portal.service.UserLocalService userLocalService;
782            @BeanReference(type = com.liferay.portal.service.UserService.class)
783            protected com.liferay.portal.service.UserService userService;
784            @BeanReference(type = UserPersistence.class)
785            protected UserPersistence userPersistence;
786            @BeanReference(type = UserFinder.class)
787            protected UserFinder userFinder;
788            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
789            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
790            private String _beanIdentifier;
791    }