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            public static com.liferay.portal.model.Address addAddress(long userId,
056                    java.lang.String className, long classPK, java.lang.String street1,
057                    java.lang.String street2, java.lang.String street3,
058                    java.lang.String city, java.lang.String zip, long regionId,
059                    long countryId, long typeId, boolean mailing, boolean primary,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException {
062                    return getService()
063                                       .addAddress(userId, className, classPK, street1, street2,
064                            street3, city, zip, regionId, countryId, typeId, mailing, primary,
065                            serviceContext);
066            }
067    
068            /**
069            * Creates a new address with the primary key. Does not add the address to the database.
070            *
071            * @param addressId the primary key for the new address
072            * @return the new address
073            */
074            public static com.liferay.portal.model.Address createAddress(long addressId) {
075                    return getService().createAddress(addressId);
076            }
077    
078            /**
079            * Deletes the address from the database. Also notifies the appropriate model listeners.
080            *
081            * @param address the address
082            * @return the address that was removed
083            */
084            public static com.liferay.portal.model.Address deleteAddress(
085                    com.liferay.portal.model.Address address) {
086                    return getService().deleteAddress(address);
087            }
088    
089            /**
090            * Deletes the address with the primary key from the database. Also notifies the appropriate model listeners.
091            *
092            * @param addressId the primary key of the address
093            * @return the address that was removed
094            * @throws PortalException if a address with the primary key could not be found
095            */
096            public static com.liferay.portal.model.Address deleteAddress(long addressId)
097                    throws com.liferay.portal.kernel.exception.PortalException {
098                    return getService().deleteAddress(addressId);
099            }
100    
101            public static void deleteAddresses(long companyId,
102                    java.lang.String className, long classPK) {
103                    getService().deleteAddresses(companyId, className, classPK);
104            }
105    
106            /**
107            * @throws PortalException
108            */
109            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
110                    com.liferay.portal.model.PersistedModel persistedModel)
111                    throws com.liferay.portal.kernel.exception.PortalException {
112                    return getService().deletePersistedModel(persistedModel);
113            }
114    
115            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
116                    return getService().dynamicQuery();
117            }
118    
119            /**
120            * Performs a dynamic query on the database and returns the matching rows.
121            *
122            * @param dynamicQuery the dynamic query
123            * @return the matching rows
124            */
125            public static <T> java.util.List<T> dynamicQuery(
126                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
127                    return getService().dynamicQuery(dynamicQuery);
128            }
129    
130            /**
131            * Performs a dynamic query on the database and returns a range of the matching rows.
132            *
133            * <p>
134            * 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.
135            * </p>
136            *
137            * @param dynamicQuery the dynamic query
138            * @param start the lower bound of the range of model instances
139            * @param end the upper bound of the range of model instances (not inclusive)
140            * @return the range of matching rows
141            */
142            public static <T> java.util.List<T> dynamicQuery(
143                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
144                    int end) {
145                    return getService().dynamicQuery(dynamicQuery, start, end);
146            }
147    
148            /**
149            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
150            *
151            * <p>
152            * 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.
153            * </p>
154            *
155            * @param dynamicQuery the dynamic query
156            * @param start the lower bound of the range of model instances
157            * @param end the upper bound of the range of model instances (not inclusive)
158            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
159            * @return the ordered range of matching rows
160            */
161            public static <T> java.util.List<T> dynamicQuery(
162                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
163                    int end,
164                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
165                    return getService()
166                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
167            }
168    
169            /**
170            * Returns the number of rows matching the dynamic query.
171            *
172            * @param dynamicQuery the dynamic query
173            * @return the number of rows matching the dynamic query
174            */
175            public static long dynamicQueryCount(
176                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
177                    return getService().dynamicQueryCount(dynamicQuery);
178            }
179    
180            /**
181            * Returns the number of rows matching the dynamic query.
182            *
183            * @param dynamicQuery the dynamic query
184            * @param projection the projection to apply to the query
185            * @return the number of rows matching the dynamic query
186            */
187            public static long dynamicQueryCount(
188                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
189                    com.liferay.portal.kernel.dao.orm.Projection projection) {
190                    return getService().dynamicQueryCount(dynamicQuery, projection);
191            }
192    
193            public static com.liferay.portal.model.Address fetchAddress(long addressId) {
194                    return getService().fetchAddress(addressId);
195            }
196    
197            /**
198            * Returns the address with the matching UUID and company.
199            *
200            * @param uuid the address's UUID
201            * @param companyId the primary key of the company
202            * @return the matching address, or <code>null</code> if a matching address could not be found
203            */
204            public static com.liferay.portal.model.Address fetchAddressByUuidAndCompanyId(
205                    java.lang.String uuid, long companyId) {
206                    return getService().fetchAddressByUuidAndCompanyId(uuid, companyId);
207            }
208    
209            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
210                    return getService().getActionableDynamicQuery();
211            }
212    
213            /**
214            * Returns the address with the primary key.
215            *
216            * @param addressId the primary key of the address
217            * @return the address
218            * @throws PortalException if a address with the primary key could not be found
219            */
220            public static com.liferay.portal.model.Address getAddress(long addressId)
221                    throws com.liferay.portal.kernel.exception.PortalException {
222                    return getService().getAddress(addressId);
223            }
224    
225            /**
226            * Returns the address with the matching UUID and company.
227            *
228            * @param uuid the address's UUID
229            * @param companyId the primary key of the company
230            * @return the matching address
231            * @throws PortalException if a matching address could not be found
232            */
233            public static com.liferay.portal.model.Address getAddressByUuidAndCompanyId(
234                    java.lang.String uuid, long companyId)
235                    throws com.liferay.portal.kernel.exception.PortalException {
236                    return getService().getAddressByUuidAndCompanyId(uuid, companyId);
237            }
238    
239            public static java.util.List<com.liferay.portal.model.Address> getAddresses() {
240                    return getService().getAddresses();
241            }
242    
243            public static java.util.List<com.liferay.portal.model.Address> getAddresses(
244                    long companyId, java.lang.String className, long classPK) {
245                    return getService().getAddresses(companyId, className, classPK);
246            }
247    
248            /**
249            * Returns a range of all the addresses.
250            *
251            * <p>
252            * 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.
253            * </p>
254            *
255            * @param start the lower bound of the range of addresses
256            * @param end the upper bound of the range of addresses (not inclusive)
257            * @return the range of addresses
258            */
259            public static java.util.List<com.liferay.portal.model.Address> getAddresses(
260                    int start, int end) {
261                    return getService().getAddresses(start, end);
262            }
263    
264            /**
265            * Returns the number of addresses.
266            *
267            * @return the number of addresses
268            */
269            public static int getAddressesCount() {
270                    return getService().getAddressesCount();
271            }
272    
273            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
274                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
275                    return getService().getExportActionableDynamicQuery(portletDataContext);
276            }
277    
278            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
279                    return getService().getIndexableActionableDynamicQuery();
280            }
281    
282            /**
283            * Returns the OSGi service identifier.
284            *
285            * @return the OSGi service identifier
286            */
287            public static java.lang.String getOSGiServiceIdentifier() {
288                    return getService().getOSGiServiceIdentifier();
289            }
290    
291            public static com.liferay.portal.model.PersistedModel getPersistedModel(
292                    java.io.Serializable primaryKeyObj)
293                    throws com.liferay.portal.kernel.exception.PortalException {
294                    return getService().getPersistedModel(primaryKeyObj);
295            }
296    
297            /**
298            * Updates the address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
299            *
300            * @param address the address
301            * @return the address that was updated
302            */
303            public static com.liferay.portal.model.Address updateAddress(
304                    com.liferay.portal.model.Address address) {
305                    return getService().updateAddress(address);
306            }
307    
308            public static com.liferay.portal.model.Address updateAddress(
309                    long addressId, java.lang.String street1, java.lang.String street2,
310                    java.lang.String street3, java.lang.String city, java.lang.String zip,
311                    long regionId, long countryId, long typeId, boolean mailing,
312                    boolean primary)
313                    throws com.liferay.portal.kernel.exception.PortalException {
314                    return getService()
315                                       .updateAddress(addressId, street1, street2, street3, city,
316                            zip, regionId, countryId, typeId, mailing, primary);
317            }
318    
319            public static AddressLocalService getService() {
320                    if (_service == null) {
321                            _service = (AddressLocalService)PortalBeanLocatorUtil.locate(AddressLocalService.class.getName());
322    
323                            ReferenceRegistry.registerReference(AddressLocalServiceUtil.class,
324                                    "_service");
325                    }
326    
327                    return _service;
328            }
329    
330            private static AddressLocalService _service;
331    }