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;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for Address. This utility wraps
024     * {@link com.liferay.portal.service.impl.AddressLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see AddressLocalService
032     * @see com.liferay.portal.service.base.AddressLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.AddressLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class AddressLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.AddressLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the address to the database. Also notifies the appropriate model listeners.
046            *
047            * @param address the address
048            * @return the address that was added
049            */
050            public static com.liferay.portal.model.Address addAddress(
051                    com.liferay.portal.model.Address address) {
052                    return getService().addAddress(address);
053            }
054    
055            /**
056            * @deprecated As of 6.2.0, replaced by {@link #addAddress(long, String,
057            long, String, String, String, String, String, long, long,
058            int, boolean, boolean, ServiceContext)}
059            */
060            @Deprecated
061            public static com.liferay.portal.model.Address addAddress(long userId,
062                    java.lang.String className, long classPK, java.lang.String street1,
063                    java.lang.String street2, java.lang.String street3,
064                    java.lang.String city, java.lang.String zip, long regionId,
065                    long countryId, long typeId, boolean mailing, boolean primary)
066                    throws com.liferay.portal.kernel.exception.PortalException {
067                    return getService()
068                                       .addAddress(userId, className, classPK, street1, street2,
069                            street3, city, zip, regionId, countryId, typeId, mailing, primary);
070            }
071    
072            public static com.liferay.portal.model.Address addAddress(long userId,
073                    java.lang.String className, long classPK, java.lang.String street1,
074                    java.lang.String street2, java.lang.String street3,
075                    java.lang.String city, java.lang.String zip, long regionId,
076                    long countryId, long typeId, boolean mailing, boolean primary,
077                    com.liferay.portal.service.ServiceContext serviceContext)
078                    throws com.liferay.portal.kernel.exception.PortalException {
079                    return getService()
080                                       .addAddress(userId, className, classPK, street1, street2,
081                            street3, city, zip, regionId, countryId, typeId, mailing, primary,
082                            serviceContext);
083            }
084    
085            /**
086            * Creates a new address with the primary key. Does not add the address to the database.
087            *
088            * @param addressId the primary key for the new address
089            * @return the new address
090            */
091            public static com.liferay.portal.model.Address createAddress(long addressId) {
092                    return getService().createAddress(addressId);
093            }
094    
095            /**
096            * Deletes the address from the database. Also notifies the appropriate model listeners.
097            *
098            * @param address the address
099            * @return the address that was removed
100            */
101            public static com.liferay.portal.model.Address deleteAddress(
102                    com.liferay.portal.model.Address address) {
103                    return getService().deleteAddress(address);
104            }
105    
106            /**
107            * Deletes the address with the primary key from the database. Also notifies the appropriate model listeners.
108            *
109            * @param addressId the primary key of the address
110            * @return the address that was removed
111            * @throws PortalException if a address with the primary key could not be found
112            */
113            public static com.liferay.portal.model.Address deleteAddress(long addressId)
114                    throws com.liferay.portal.kernel.exception.PortalException {
115                    return getService().deleteAddress(addressId);
116            }
117    
118            public static void deleteAddresses(long companyId,
119                    java.lang.String className, long classPK) {
120                    getService().deleteAddresses(companyId, className, classPK);
121            }
122    
123            /**
124            * @throws PortalException
125            */
126            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
127                    com.liferay.portal.model.PersistedModel persistedModel)
128                    throws com.liferay.portal.kernel.exception.PortalException {
129                    return getService().deletePersistedModel(persistedModel);
130            }
131    
132            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
133                    return getService().dynamicQuery();
134            }
135    
136            /**
137            * Performs a dynamic query on the database and returns the matching rows.
138            *
139            * @param dynamicQuery the dynamic query
140            * @return the matching rows
141            */
142            public static <T> java.util.List<T> dynamicQuery(
143                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
144                    return getService().dynamicQuery(dynamicQuery);
145            }
146    
147            /**
148            * Performs a dynamic query on the database and returns a range of the matching rows.
149            *
150            * <p>
151            * 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.
152            * </p>
153            *
154            * @param dynamicQuery the dynamic query
155            * @param start the lower bound of the range of model instances
156            * @param end the upper bound of the range of model instances (not inclusive)
157            * @return the range of matching rows
158            */
159            public static <T> java.util.List<T> dynamicQuery(
160                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
161                    int end) {
162                    return getService().dynamicQuery(dynamicQuery, start, end);
163            }
164    
165            /**
166            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
167            *
168            * <p>
169            * 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.
170            * </p>
171            *
172            * @param dynamicQuery the dynamic query
173            * @param start the lower bound of the range of model instances
174            * @param end the upper bound of the range of model instances (not inclusive)
175            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
176            * @return the ordered range of matching rows
177            */
178            public static <T> java.util.List<T> dynamicQuery(
179                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
180                    int end,
181                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
182                    return getService()
183                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
184            }
185    
186            /**
187            * Returns the number of rows matching the dynamic query.
188            *
189            * @param dynamicQuery the dynamic query
190            * @return the number of rows matching the dynamic query
191            */
192            public static long dynamicQueryCount(
193                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
194                    return getService().dynamicQueryCount(dynamicQuery);
195            }
196    
197            /**
198            * Returns the number of rows matching the dynamic query.
199            *
200            * @param dynamicQuery the dynamic query
201            * @param projection the projection to apply to the query
202            * @return the number of rows matching the dynamic query
203            */
204            public static long dynamicQueryCount(
205                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
206                    com.liferay.portal.kernel.dao.orm.Projection projection) {
207                    return getService().dynamicQueryCount(dynamicQuery, projection);
208            }
209    
210            public static com.liferay.portal.model.Address fetchAddress(long addressId) {
211                    return getService().fetchAddress(addressId);
212            }
213    
214            /**
215            * Returns the address with the matching UUID and company.
216            *
217            * @param uuid the address's UUID
218            * @param companyId the primary key of the company
219            * @return the matching address, or <code>null</code> if a matching address could not be found
220            */
221            public static com.liferay.portal.model.Address fetchAddressByUuidAndCompanyId(
222                    java.lang.String uuid, long companyId) {
223                    return getService().fetchAddressByUuidAndCompanyId(uuid, companyId);
224            }
225    
226            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
227                    return getService().getActionableDynamicQuery();
228            }
229    
230            /**
231            * Returns the address with the primary key.
232            *
233            * @param addressId the primary key of the address
234            * @return the address
235            * @throws PortalException if a address with the primary key could not be found
236            */
237            public static com.liferay.portal.model.Address getAddress(long addressId)
238                    throws com.liferay.portal.kernel.exception.PortalException {
239                    return getService().getAddress(addressId);
240            }
241    
242            /**
243            * Returns the address with the matching UUID and company.
244            *
245            * @param uuid the address's UUID
246            * @param companyId the primary key of the company
247            * @return the matching address
248            * @throws PortalException if a matching address could not be found
249            */
250            public static com.liferay.portal.model.Address getAddressByUuidAndCompanyId(
251                    java.lang.String uuid, long companyId)
252                    throws com.liferay.portal.kernel.exception.PortalException {
253                    return getService().getAddressByUuidAndCompanyId(uuid, companyId);
254            }
255    
256            public static java.util.List<com.liferay.portal.model.Address> getAddresses() {
257                    return getService().getAddresses();
258            }
259    
260            public static java.util.List<com.liferay.portal.model.Address> getAddresses(
261                    long companyId, java.lang.String className, long classPK) {
262                    return getService().getAddresses(companyId, className, classPK);
263            }
264    
265            /**
266            * Returns a range of all the addresses.
267            *
268            * <p>
269            * 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.
270            * </p>
271            *
272            * @param start the lower bound of the range of addresses
273            * @param end the upper bound of the range of addresses (not inclusive)
274            * @return the range of addresses
275            */
276            public static java.util.List<com.liferay.portal.model.Address> getAddresses(
277                    int start, int end) {
278                    return getService().getAddresses(start, end);
279            }
280    
281            /**
282            * Returns the number of addresses.
283            *
284            * @return the number of addresses
285            */
286            public static int getAddressesCount() {
287                    return getService().getAddressesCount();
288            }
289    
290            /**
291            * Returns the Spring bean ID for this bean.
292            *
293            * @return the Spring bean ID for this bean
294            */
295            public static java.lang.String getBeanIdentifier() {
296                    return getService().getBeanIdentifier();
297            }
298    
299            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
300                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
301                    return getService().getExportActionableDynamicQuery(portletDataContext);
302            }
303    
304            public static com.liferay.portal.model.PersistedModel getPersistedModel(
305                    java.io.Serializable primaryKeyObj)
306                    throws com.liferay.portal.kernel.exception.PortalException {
307                    return getService().getPersistedModel(primaryKeyObj);
308            }
309    
310            /**
311            * Sets the Spring bean ID for this bean.
312            *
313            * @param beanIdentifier the Spring bean ID for this bean
314            */
315            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
316                    getService().setBeanIdentifier(beanIdentifier);
317            }
318    
319            /**
320            * Updates the address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
321            *
322            * @param address the address
323            * @return the address that was updated
324            */
325            public static com.liferay.portal.model.Address updateAddress(
326                    com.liferay.portal.model.Address address) {
327                    return getService().updateAddress(address);
328            }
329    
330            public static com.liferay.portal.model.Address updateAddress(
331                    long addressId, java.lang.String street1, java.lang.String street2,
332                    java.lang.String street3, java.lang.String city, java.lang.String zip,
333                    long regionId, long countryId, long typeId, boolean mailing,
334                    boolean primary)
335                    throws com.liferay.portal.kernel.exception.PortalException {
336                    return getService()
337                                       .updateAddress(addressId, street1, street2, street3, city,
338                            zip, regionId, countryId, typeId, mailing, primary);
339            }
340    
341            public static AddressLocalService getService() {
342                    if (_service == null) {
343                            _service = (AddressLocalService)PortalBeanLocatorUtil.locate(AddressLocalService.class.getName());
344    
345                            ReferenceRegistry.registerReference(AddressLocalServiceUtil.class,
346                                    "_service");
347                    }
348    
349                    return _service;
350            }
351    
352            /**
353             * @deprecated As of 6.2.0
354             */
355            @Deprecated
356            public void setService(AddressLocalService service) {
357            }
358    
359            private static AddressLocalService _service;
360    }