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 EmailAddress. This utility wraps 024 * {@link com.liferay.portal.service.impl.EmailAddressLocalServiceImpl} 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 EmailAddressLocalService 032 * @see com.liferay.portal.service.base.EmailAddressLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.EmailAddressLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class EmailAddressLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.EmailAddressLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the email address to the database. Also notifies the appropriate model listeners. 046 * 047 * @param emailAddress the email address 048 * @return the email address that was added 049 */ 050 public static com.liferay.portal.model.EmailAddress addEmailAddress( 051 com.liferay.portal.model.EmailAddress emailAddress) { 052 return getService().addEmailAddress(emailAddress); 053 } 054 055 public static com.liferay.portal.model.EmailAddress addEmailAddress( 056 long userId, java.lang.String className, long classPK, 057 java.lang.String address, long typeId, boolean primary, 058 com.liferay.portal.service.ServiceContext serviceContext) 059 throws com.liferay.portal.kernel.exception.PortalException { 060 return getService() 061 .addEmailAddress(userId, className, classPK, address, 062 typeId, primary, serviceContext); 063 } 064 065 /** 066 * Creates a new email address with the primary key. Does not add the email address to the database. 067 * 068 * @param emailAddressId the primary key for the new email address 069 * @return the new email address 070 */ 071 public static com.liferay.portal.model.EmailAddress createEmailAddress( 072 long emailAddressId) { 073 return getService().createEmailAddress(emailAddressId); 074 } 075 076 /** 077 * Deletes the email address from the database. Also notifies the appropriate model listeners. 078 * 079 * @param emailAddress the email address 080 * @return the email address that was removed 081 */ 082 public static com.liferay.portal.model.EmailAddress deleteEmailAddress( 083 com.liferay.portal.model.EmailAddress emailAddress) { 084 return getService().deleteEmailAddress(emailAddress); 085 } 086 087 /** 088 * Deletes the email address with the primary key from the database. Also notifies the appropriate model listeners. 089 * 090 * @param emailAddressId the primary key of the email address 091 * @return the email address that was removed 092 * @throws PortalException if a email address with the primary key could not be found 093 */ 094 public static com.liferay.portal.model.EmailAddress deleteEmailAddress( 095 long emailAddressId) 096 throws com.liferay.portal.kernel.exception.PortalException { 097 return getService().deleteEmailAddress(emailAddressId); 098 } 099 100 public static void deleteEmailAddresses(long companyId, 101 java.lang.String className, long classPK) { 102 getService().deleteEmailAddresses(companyId, className, classPK); 103 } 104 105 /** 106 * @throws PortalException 107 */ 108 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 109 com.liferay.portal.model.PersistedModel persistedModel) 110 throws com.liferay.portal.kernel.exception.PortalException { 111 return getService().deletePersistedModel(persistedModel); 112 } 113 114 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 115 return getService().dynamicQuery(); 116 } 117 118 /** 119 * Performs a dynamic query on the database and returns the matching rows. 120 * 121 * @param dynamicQuery the dynamic query 122 * @return the matching rows 123 */ 124 public static <T> java.util.List<T> dynamicQuery( 125 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 126 return getService().dynamicQuery(dynamicQuery); 127 } 128 129 /** 130 * Performs a dynamic query on the database and returns a 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.EmailAddressModelImpl}. 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 * @return the range of matching rows 140 */ 141 public static <T> java.util.List<T> dynamicQuery( 142 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 143 int end) { 144 return getService().dynamicQuery(dynamicQuery, start, end); 145 } 146 147 /** 148 * Performs a dynamic query on the database and returns an ordered 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.EmailAddressModelImpl}. 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 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 158 * @return the ordered range of matching rows 159 */ 160 public static <T> java.util.List<T> dynamicQuery( 161 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 162 int end, 163 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 164 return getService() 165 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 166 } 167 168 /** 169 * Returns the number of rows matching the dynamic query. 170 * 171 * @param dynamicQuery the dynamic query 172 * @return the number of rows matching the dynamic query 173 */ 174 public static long dynamicQueryCount( 175 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 176 return getService().dynamicQueryCount(dynamicQuery); 177 } 178 179 /** 180 * Returns the number of rows matching the dynamic query. 181 * 182 * @param dynamicQuery the dynamic query 183 * @param projection the projection to apply to the query 184 * @return the number of rows matching the dynamic query 185 */ 186 public static long dynamicQueryCount( 187 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 188 com.liferay.portal.kernel.dao.orm.Projection projection) { 189 return getService().dynamicQueryCount(dynamicQuery, projection); 190 } 191 192 public static com.liferay.portal.model.EmailAddress fetchEmailAddress( 193 long emailAddressId) { 194 return getService().fetchEmailAddress(emailAddressId); 195 } 196 197 /** 198 * Returns the email address with the matching UUID and company. 199 * 200 * @param uuid the email address's UUID 201 * @param companyId the primary key of the company 202 * @return the matching email address, or <code>null</code> if a matching email address could not be found 203 */ 204 public static com.liferay.portal.model.EmailAddress fetchEmailAddressByUuidAndCompanyId( 205 java.lang.String uuid, long companyId) { 206 return getService().fetchEmailAddressByUuidAndCompanyId(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 email address with the primary key. 215 * 216 * @param emailAddressId the primary key of the email address 217 * @return the email address 218 * @throws PortalException if a email address with the primary key could not be found 219 */ 220 public static com.liferay.portal.model.EmailAddress getEmailAddress( 221 long emailAddressId) 222 throws com.liferay.portal.kernel.exception.PortalException { 223 return getService().getEmailAddress(emailAddressId); 224 } 225 226 /** 227 * Returns the email address with the matching UUID and company. 228 * 229 * @param uuid the email address's UUID 230 * @param companyId the primary key of the company 231 * @return the matching email address 232 * @throws PortalException if a matching email address could not be found 233 */ 234 public static com.liferay.portal.model.EmailAddress getEmailAddressByUuidAndCompanyId( 235 java.lang.String uuid, long companyId) 236 throws com.liferay.portal.kernel.exception.PortalException { 237 return getService().getEmailAddressByUuidAndCompanyId(uuid, companyId); 238 } 239 240 public static java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses() { 241 return getService().getEmailAddresses(); 242 } 243 244 public static java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses( 245 long companyId, java.lang.String className, long classPK) { 246 return getService().getEmailAddresses(companyId, className, classPK); 247 } 248 249 /** 250 * Returns a range of all the email addresses. 251 * 252 * <p> 253 * 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.EmailAddressModelImpl}. 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. 254 * </p> 255 * 256 * @param start the lower bound of the range of email addresses 257 * @param end the upper bound of the range of email addresses (not inclusive) 258 * @return the range of email addresses 259 */ 260 public static java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses( 261 int start, int end) { 262 return getService().getEmailAddresses(start, end); 263 } 264 265 /** 266 * Returns the number of email addresses. 267 * 268 * @return the number of email addresses 269 */ 270 public static int getEmailAddressesCount() { 271 return getService().getEmailAddressesCount(); 272 } 273 274 public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 275 com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) { 276 return getService().getExportActionableDynamicQuery(portletDataContext); 277 } 278 279 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 280 return getService().getIndexableActionableDynamicQuery(); 281 } 282 283 /** 284 * Returns the OSGi service identifier. 285 * 286 * @return the OSGi service identifier 287 */ 288 public static java.lang.String getOSGiServiceIdentifier() { 289 return getService().getOSGiServiceIdentifier(); 290 } 291 292 public static com.liferay.portal.model.PersistedModel getPersistedModel( 293 java.io.Serializable primaryKeyObj) 294 throws com.liferay.portal.kernel.exception.PortalException { 295 return getService().getPersistedModel(primaryKeyObj); 296 } 297 298 /** 299 * Updates the email address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 300 * 301 * @param emailAddress the email address 302 * @return the email address that was updated 303 */ 304 public static com.liferay.portal.model.EmailAddress updateEmailAddress( 305 com.liferay.portal.model.EmailAddress emailAddress) { 306 return getService().updateEmailAddress(emailAddress); 307 } 308 309 public static com.liferay.portal.model.EmailAddress updateEmailAddress( 310 long emailAddressId, java.lang.String address, long typeId, 311 boolean primary) 312 throws com.liferay.portal.kernel.exception.PortalException { 313 return getService() 314 .updateEmailAddress(emailAddressId, address, typeId, primary); 315 } 316 317 public static EmailAddressLocalService getService() { 318 if (_service == null) { 319 _service = (EmailAddressLocalService)PortalBeanLocatorUtil.locate(EmailAddressLocalService.class.getName()); 320 321 ReferenceRegistry.registerReference(EmailAddressLocalServiceUtil.class, 322 "_service"); 323 } 324 325 return _service; 326 } 327 328 private static EmailAddressLocalService _service; 329 }