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.lar.ExportImportHelperUtil;
036    import com.liferay.portal.kernel.lar.ManifestSummary;
037    import com.liferay.portal.kernel.lar.PortletDataContext;
038    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
039    import com.liferay.portal.kernel.lar.StagedModelType;
040    import com.liferay.portal.kernel.search.Indexable;
041    import com.liferay.portal.kernel.search.IndexableType;
042    import com.liferay.portal.kernel.util.OrderByComparator;
043    import com.liferay.portal.model.Address;
044    import com.liferay.portal.model.PersistedModel;
045    import com.liferay.portal.service.AddressLocalService;
046    import com.liferay.portal.service.BaseLocalServiceImpl;
047    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
048    import com.liferay.portal.service.persistence.AddressPersistence;
049    import com.liferay.portal.service.persistence.ClassNamePersistence;
050    import com.liferay.portal.service.persistence.CountryPersistence;
051    import com.liferay.portal.service.persistence.ListTypePersistence;
052    import com.liferay.portal.service.persistence.UserFinder;
053    import com.liferay.portal.service.persistence.UserPersistence;
054    import com.liferay.portal.util.PortalUtil;
055    
056    import java.io.Serializable;
057    
058    import java.util.List;
059    
060    import javax.sql.DataSource;
061    
062    /**
063     * Provides the base implementation for the address local service.
064     *
065     * <p>
066     * 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}.
067     * </p>
068     *
069     * @author Brian Wing Shun Chan
070     * @see com.liferay.portal.service.impl.AddressLocalServiceImpl
071     * @see com.liferay.portal.service.AddressLocalServiceUtil
072     * @generated
073     */
074    @ProviderType
075    public abstract class AddressLocalServiceBaseImpl extends BaseLocalServiceImpl
076            implements AddressLocalService, IdentifiableBean {
077            /*
078             * NOTE FOR DEVELOPERS:
079             *
080             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.AddressLocalServiceUtil} to access the address local service.
081             */
082    
083            /**
084             * Adds the address to the database. Also notifies the appropriate model listeners.
085             *
086             * @param address the address
087             * @return the address that was added
088             */
089            @Indexable(type = IndexableType.REINDEX)
090            @Override
091            public Address addAddress(Address address) {
092                    address.setNew(true);
093    
094                    return addressPersistence.update(address);
095            }
096    
097            /**
098             * Creates a new address with the primary key. Does not add the address to the database.
099             *
100             * @param addressId the primary key for the new address
101             * @return the new address
102             */
103            @Override
104            public Address createAddress(long addressId) {
105                    return addressPersistence.create(addressId);
106            }
107    
108            /**
109             * Deletes the address with the primary key from the database. Also notifies the appropriate model listeners.
110             *
111             * @param addressId the primary key of the address
112             * @return the address that was removed
113             * @throws PortalException if a address with the primary key could not be found
114             */
115            @Indexable(type = IndexableType.DELETE)
116            @Override
117            public Address deleteAddress(long addressId) throws PortalException {
118                    return addressPersistence.remove(addressId);
119            }
120    
121            /**
122             * Deletes the address from the database. Also notifies the appropriate model listeners.
123             *
124             * @param address the address
125             * @return the address that was removed
126             */
127            @Indexable(type = IndexableType.DELETE)
128            @Override
129            public Address deleteAddress(Address address) {
130                    return addressPersistence.remove(address);
131            }
132    
133            @Override
134            public DynamicQuery dynamicQuery() {
135                    Class<?> clazz = getClass();
136    
137                    return DynamicQueryFactoryUtil.forClass(Address.class,
138                            clazz.getClassLoader());
139            }
140    
141            /**
142             * Performs a dynamic query on the database and returns the matching rows.
143             *
144             * @param dynamicQuery the dynamic query
145             * @return the matching rows
146             */
147            @Override
148            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
149                    return addressPersistence.findWithDynamicQuery(dynamicQuery);
150            }
151    
152            /**
153             * Performs a dynamic query on the database and returns a range of the matching rows.
154             *
155             * <p>
156             * 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.
157             * </p>
158             *
159             * @param dynamicQuery the dynamic query
160             * @param start the lower bound of the range of model instances
161             * @param end the upper bound of the range of model instances (not inclusive)
162             * @return the range of matching rows
163             */
164            @Override
165            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
166                    int end) {
167                    return addressPersistence.findWithDynamicQuery(dynamicQuery, start, end);
168            }
169    
170            /**
171             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
172             *
173             * <p>
174             * 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.
175             * </p>
176             *
177             * @param dynamicQuery the dynamic query
178             * @param start the lower bound of the range of model instances
179             * @param end the upper bound of the range of model instances (not inclusive)
180             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
181             * @return the ordered range of matching rows
182             */
183            @Override
184            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
185                    int end, OrderByComparator<T> orderByComparator) {
186                    return addressPersistence.findWithDynamicQuery(dynamicQuery, start,
187                            end, orderByComparator);
188            }
189    
190            /**
191             * Returns the number of rows matching the dynamic query.
192             *
193             * @param dynamicQuery the dynamic query
194             * @return the number of rows matching the dynamic query
195             */
196            @Override
197            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
198                    return addressPersistence.countWithDynamicQuery(dynamicQuery);
199            }
200    
201            /**
202             * Returns the number of rows matching the dynamic query.
203             *
204             * @param dynamicQuery the dynamic query
205             * @param projection the projection to apply to the query
206             * @return the number of rows matching the dynamic query
207             */
208            @Override
209            public long dynamicQueryCount(DynamicQuery dynamicQuery,
210                    Projection projection) {
211                    return addressPersistence.countWithDynamicQuery(dynamicQuery, projection);
212            }
213    
214            @Override
215            public Address fetchAddress(long addressId) {
216                    return addressPersistence.fetchByPrimaryKey(addressId);
217            }
218    
219            /**
220             * Returns the address with the matching UUID and company.
221             *
222             * @param uuid the address's UUID
223             * @param companyId the primary key of the company
224             * @return the matching address, or <code>null</code> if a matching address could not be found
225             */
226            @Override
227            public Address fetchAddressByUuidAndCompanyId(String uuid, long companyId) {
228                    return addressPersistence.fetchByUuid_C_First(uuid, companyId, null);
229            }
230    
231            /**
232             * Returns the address with the primary key.
233             *
234             * @param addressId the primary key of the address
235             * @return the address
236             * @throws PortalException if a address with the primary key could not be found
237             */
238            @Override
239            public Address getAddress(long addressId) throws PortalException {
240                    return addressPersistence.findByPrimaryKey(addressId);
241            }
242    
243            @Override
244            public ActionableDynamicQuery getActionableDynamicQuery() {
245                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
246    
247                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.AddressLocalServiceUtil.getService());
248                    actionableDynamicQuery.setClass(Address.class);
249                    actionableDynamicQuery.setClassLoader(getClassLoader());
250    
251                    actionableDynamicQuery.setPrimaryKeyPropertyName("addressId");
252    
253                    return actionableDynamicQuery;
254            }
255    
256            protected void initActionableDynamicQuery(
257                    ActionableDynamicQuery actionableDynamicQuery) {
258                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.AddressLocalServiceUtil.getService());
259                    actionableDynamicQuery.setClass(Address.class);
260                    actionableDynamicQuery.setClassLoader(getClassLoader());
261    
262                    actionableDynamicQuery.setPrimaryKeyPropertyName("addressId");
263            }
264    
265            @Override
266            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
267                    final PortletDataContext portletDataContext) {
268                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
269                                    @Override
270                                    public long performCount() throws PortalException {
271                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
272    
273                                            StagedModelType stagedModelType = getStagedModelType();
274    
275                                            long modelAdditionCount = super.performCount();
276    
277                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
278                                                    modelAdditionCount);
279    
280                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
281                                                            stagedModelType);
282    
283                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
284                                                    modelDeletionCount);
285    
286                                            return modelAdditionCount;
287                                    }
288                            };
289    
290                    initActionableDynamicQuery(exportActionableDynamicQuery);
291    
292                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
293                                    @Override
294                                    public void addCriteria(DynamicQuery dynamicQuery) {
295                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
296                                                    "modifiedDate");
297    
298                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
299    
300                                            if (stagedModelType.getReferrerClassNameId() >= 0) {
301                                                    Property classNameIdProperty = PropertyFactoryUtil.forName(
302                                                                    "classNameId");
303    
304                                                    dynamicQuery.add(classNameIdProperty.eq(
305                                                                    stagedModelType.getReferrerClassNameId()));
306                                            }
307                                    }
308                            });
309    
310                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
311    
312                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
313                                    @Override
314                                    public void performAction(Object object)
315                                            throws PortalException {
316                                            Address stagedModel = (Address)object;
317    
318                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
319                                                    stagedModel);
320                                    }
321                            });
322                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
323                                    PortalUtil.getClassNameId(Address.class.getName())));
324    
325                    return exportActionableDynamicQuery;
326            }
327    
328            /**
329             * @throws PortalException
330             */
331            @Override
332            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
333                    throws PortalException {
334                    return addressLocalService.deleteAddress((Address)persistedModel);
335            }
336    
337            @Override
338            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
339                    throws PortalException {
340                    return addressPersistence.findByPrimaryKey(primaryKeyObj);
341            }
342    
343            /**
344             * Returns the address with the matching UUID and company.
345             *
346             * @param uuid the address's UUID
347             * @param companyId the primary key of the company
348             * @return the matching address
349             * @throws PortalException if a matching address could not be found
350             */
351            @Override
352            public Address getAddressByUuidAndCompanyId(String uuid, long companyId)
353                    throws PortalException {
354                    return addressPersistence.findByUuid_C_First(uuid, companyId, null);
355            }
356    
357            /**
358             * Returns a range of all the addresses.
359             *
360             * <p>
361             * 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.
362             * </p>
363             *
364             * @param start the lower bound of the range of addresses
365             * @param end the upper bound of the range of addresses (not inclusive)
366             * @return the range of addresses
367             */
368            @Override
369            public List<Address> getAddresses(int start, int end) {
370                    return addressPersistence.findAll(start, end);
371            }
372    
373            /**
374             * Returns the number of addresses.
375             *
376             * @return the number of addresses
377             */
378            @Override
379            public int getAddressesCount() {
380                    return addressPersistence.countAll();
381            }
382    
383            /**
384             * Updates the address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
385             *
386             * @param address the address
387             * @return the address that was updated
388             */
389            @Indexable(type = IndexableType.REINDEX)
390            @Override
391            public Address updateAddress(Address address) {
392                    return addressPersistence.update(address);
393            }
394    
395            /**
396             * Returns the address local service.
397             *
398             * @return the address local service
399             */
400            public com.liferay.portal.service.AddressLocalService getAddressLocalService() {
401                    return addressLocalService;
402            }
403    
404            /**
405             * Sets the address local service.
406             *
407             * @param addressLocalService the address local service
408             */
409            public void setAddressLocalService(
410                    com.liferay.portal.service.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 remote service.
566             *
567             * @return the list type remote service
568             */
569            public com.liferay.portal.service.ListTypeService getListTypeService() {
570                    return listTypeService;
571            }
572    
573            /**
574             * Sets the list type remote service.
575             *
576             * @param listTypeService the list type remote service
577             */
578            public void setListTypeService(
579                    com.liferay.portal.service.ListTypeService listTypeService) {
580                    this.listTypeService = listTypeService;
581            }
582    
583            /**
584             * Returns the list type persistence.
585             *
586             * @return the list type persistence
587             */
588            public ListTypePersistence getListTypePersistence() {
589                    return listTypePersistence;
590            }
591    
592            /**
593             * Sets the list type persistence.
594             *
595             * @param listTypePersistence the list type persistence
596             */
597            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
598                    this.listTypePersistence = listTypePersistence;
599            }
600    
601            /**
602             * Returns the user local service.
603             *
604             * @return the user local service
605             */
606            public com.liferay.portal.service.UserLocalService getUserLocalService() {
607                    return userLocalService;
608            }
609    
610            /**
611             * Sets the user local service.
612             *
613             * @param userLocalService the user local service
614             */
615            public void setUserLocalService(
616                    com.liferay.portal.service.UserLocalService userLocalService) {
617                    this.userLocalService = userLocalService;
618            }
619    
620            /**
621             * Returns the user remote service.
622             *
623             * @return the user remote service
624             */
625            public com.liferay.portal.service.UserService getUserService() {
626                    return userService;
627            }
628    
629            /**
630             * Sets the user remote service.
631             *
632             * @param userService the user remote service
633             */
634            public void setUserService(
635                    com.liferay.portal.service.UserService userService) {
636                    this.userService = userService;
637            }
638    
639            /**
640             * Returns the user persistence.
641             *
642             * @return the user persistence
643             */
644            public UserPersistence getUserPersistence() {
645                    return userPersistence;
646            }
647    
648            /**
649             * Sets the user persistence.
650             *
651             * @param userPersistence the user persistence
652             */
653            public void setUserPersistence(UserPersistence userPersistence) {
654                    this.userPersistence = userPersistence;
655            }
656    
657            /**
658             * Returns the user finder.
659             *
660             * @return the user finder
661             */
662            public UserFinder getUserFinder() {
663                    return userFinder;
664            }
665    
666            /**
667             * Sets the user finder.
668             *
669             * @param userFinder the user finder
670             */
671            public void setUserFinder(UserFinder userFinder) {
672                    this.userFinder = userFinder;
673            }
674    
675            public void afterPropertiesSet() {
676                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Address",
677                            addressLocalService);
678            }
679    
680            public void destroy() {
681                    persistedModelLocalServiceRegistry.unregister(
682                            "com.liferay.portal.model.Address");
683            }
684    
685            /**
686             * Returns the Spring bean ID for this bean.
687             *
688             * @return the Spring bean ID for this bean
689             */
690            @Override
691            public String getBeanIdentifier() {
692                    return _beanIdentifier;
693            }
694    
695            /**
696             * Sets the Spring bean ID for this bean.
697             *
698             * @param beanIdentifier the Spring bean ID for this bean
699             */
700            @Override
701            public void setBeanIdentifier(String beanIdentifier) {
702                    _beanIdentifier = beanIdentifier;
703            }
704    
705            protected Class<?> getModelClass() {
706                    return Address.class;
707            }
708    
709            protected String getModelClassName() {
710                    return Address.class.getName();
711            }
712    
713            /**
714             * Performs a SQL query.
715             *
716             * @param sql the sql query
717             */
718            protected void runSQL(String sql) {
719                    try {
720                            DataSource dataSource = addressPersistence.getDataSource();
721    
722                            DB db = DBFactoryUtil.getDB();
723    
724                            sql = db.buildSQL(sql);
725                            sql = PortalUtil.transformSQL(sql);
726    
727                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
728                                            sql, new int[0]);
729    
730                            sqlUpdate.update();
731                    }
732                    catch (Exception e) {
733                            throw new SystemException(e);
734                    }
735            }
736    
737            @BeanReference(type = com.liferay.portal.service.AddressLocalService.class)
738            protected com.liferay.portal.service.AddressLocalService addressLocalService;
739            @BeanReference(type = com.liferay.portal.service.AddressService.class)
740            protected com.liferay.portal.service.AddressService addressService;
741            @BeanReference(type = AddressPersistence.class)
742            protected AddressPersistence addressPersistence;
743            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
744            protected com.liferay.counter.service.CounterLocalService counterLocalService;
745            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
746            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
747            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
748            protected com.liferay.portal.service.ClassNameService classNameService;
749            @BeanReference(type = ClassNamePersistence.class)
750            protected ClassNamePersistence classNamePersistence;
751            @BeanReference(type = com.liferay.portal.service.CountryService.class)
752            protected com.liferay.portal.service.CountryService countryService;
753            @BeanReference(type = CountryPersistence.class)
754            protected CountryPersistence countryPersistence;
755            @BeanReference(type = com.liferay.portal.service.ListTypeService.class)
756            protected com.liferay.portal.service.ListTypeService listTypeService;
757            @BeanReference(type = ListTypePersistence.class)
758            protected ListTypePersistence listTypePersistence;
759            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
760            protected com.liferay.portal.service.UserLocalService userLocalService;
761            @BeanReference(type = com.liferay.portal.service.UserService.class)
762            protected com.liferay.portal.service.UserService userService;
763            @BeanReference(type = UserPersistence.class)
764            protected UserPersistence userPersistence;
765            @BeanReference(type = UserFinder.class)
766            protected UserFinder userFinder;
767            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
768            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
769            private String _beanIdentifier;
770    }