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