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