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