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 Contact. This utility wraps 024 * {@link com.liferay.portal.service.impl.ContactLocalServiceImpl} 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 ContactLocalService 032 * @see com.liferay.portal.service.base.ContactLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.ContactLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class ContactLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ContactLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the contact to the database. Also notifies the appropriate model listeners. 046 * 047 * @param contact the contact 048 * @return the contact that was added 049 */ 050 public static com.liferay.portal.model.Contact addContact( 051 com.liferay.portal.model.Contact contact) { 052 return getService().addContact(contact); 053 } 054 055 public static com.liferay.portal.model.Contact addContact(long userId, 056 java.lang.String className, long classPK, 057 java.lang.String emailAddress, java.lang.String firstName, 058 java.lang.String middleName, java.lang.String lastName, int prefixId, 059 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 060 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 061 java.lang.String facebookSn, java.lang.String icqSn, 062 java.lang.String jabberSn, java.lang.String msnSn, 063 java.lang.String mySpaceSn, java.lang.String skypeSn, 064 java.lang.String twitterSn, java.lang.String ymSn, 065 java.lang.String jobTitle) 066 throws com.liferay.portal.kernel.exception.PortalException { 067 return getService() 068 .addContact(userId, className, classPK, emailAddress, 069 firstName, middleName, lastName, prefixId, suffixId, male, 070 birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn, facebookSn, 071 icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn, ymSn, 072 jobTitle); 073 } 074 075 /** 076 * Creates a new contact with the primary key. Does not add the contact to the database. 077 * 078 * @param contactId the primary key for the new contact 079 * @return the new contact 080 */ 081 public static com.liferay.portal.model.Contact createContact(long contactId) { 082 return getService().createContact(contactId); 083 } 084 085 /** 086 * Deletes the contact from the database. Also notifies the appropriate model listeners. 087 * 088 * @param contact the contact 089 * @return the contact that was removed 090 */ 091 public static com.liferay.portal.model.Contact deleteContact( 092 com.liferay.portal.model.Contact contact) { 093 return getService().deleteContact(contact); 094 } 095 096 /** 097 * Deletes the contact with the primary key from the database. Also notifies the appropriate model listeners. 098 * 099 * @param contactId the primary key of the contact 100 * @return the contact that was removed 101 * @throws PortalException if a contact with the primary key could not be found 102 */ 103 public static com.liferay.portal.model.Contact deleteContact(long contactId) 104 throws com.liferay.portal.kernel.exception.PortalException { 105 return getService().deleteContact(contactId); 106 } 107 108 /** 109 * @throws PortalException 110 */ 111 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 112 com.liferay.portal.model.PersistedModel persistedModel) 113 throws com.liferay.portal.kernel.exception.PortalException { 114 return getService().deletePersistedModel(persistedModel); 115 } 116 117 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 118 return getService().dynamicQuery(); 119 } 120 121 /** 122 * Performs a dynamic query on the database and returns the matching rows. 123 * 124 * @param dynamicQuery the dynamic query 125 * @return the matching rows 126 */ 127 public static <T> java.util.List<T> dynamicQuery( 128 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 129 return getService().dynamicQuery(dynamicQuery); 130 } 131 132 /** 133 * Performs a dynamic query on the database and returns a range of the matching rows. 134 * 135 * <p> 136 * 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.ContactModelImpl}. 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. 137 * </p> 138 * 139 * @param dynamicQuery the dynamic query 140 * @param start the lower bound of the range of model instances 141 * @param end the upper bound of the range of model instances (not inclusive) 142 * @return the range of matching rows 143 */ 144 public static <T> java.util.List<T> dynamicQuery( 145 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 146 int end) { 147 return getService().dynamicQuery(dynamicQuery, start, end); 148 } 149 150 /** 151 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 152 * 153 * <p> 154 * 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.ContactModelImpl}. 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. 155 * </p> 156 * 157 * @param dynamicQuery the dynamic query 158 * @param start the lower bound of the range of model instances 159 * @param end the upper bound of the range of model instances (not inclusive) 160 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 161 * @return the ordered range of matching rows 162 */ 163 public static <T> java.util.List<T> dynamicQuery( 164 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 165 int end, 166 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 167 return getService() 168 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 169 } 170 171 /** 172 * Returns the number of rows matching the dynamic query. 173 * 174 * @param dynamicQuery the dynamic query 175 * @return the number of rows matching the dynamic query 176 */ 177 public static long dynamicQueryCount( 178 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 179 return getService().dynamicQueryCount(dynamicQuery); 180 } 181 182 /** 183 * Returns the number of rows matching the dynamic query. 184 * 185 * @param dynamicQuery the dynamic query 186 * @param projection the projection to apply to the query 187 * @return the number of rows matching the dynamic query 188 */ 189 public static long dynamicQueryCount( 190 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 191 com.liferay.portal.kernel.dao.orm.Projection projection) { 192 return getService().dynamicQueryCount(dynamicQuery, projection); 193 } 194 195 public static com.liferay.portal.model.Contact fetchContact(long contactId) { 196 return getService().fetchContact(contactId); 197 } 198 199 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 200 return getService().getActionableDynamicQuery(); 201 } 202 203 /** 204 * Returns the Spring bean ID for this bean. 205 * 206 * @return the Spring bean ID for this bean 207 */ 208 public static java.lang.String getBeanIdentifier() { 209 return getService().getBeanIdentifier(); 210 } 211 212 /** 213 * Returns the contact with the primary key. 214 * 215 * @param contactId the primary key of the contact 216 * @return the contact 217 * @throws PortalException if a contact with the primary key could not be found 218 */ 219 public static com.liferay.portal.model.Contact getContact(long contactId) 220 throws com.liferay.portal.kernel.exception.PortalException { 221 return getService().getContact(contactId); 222 } 223 224 public static java.util.List<com.liferay.portal.model.Contact> getContacts( 225 long classNameId, long classPK, int start, int end, 226 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Contact> orderByComparator) { 227 return getService() 228 .getContacts(classNameId, classPK, start, end, 229 orderByComparator); 230 } 231 232 /** 233 * Returns a range of all the contacts. 234 * 235 * <p> 236 * 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.ContactModelImpl}. 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. 237 * </p> 238 * 239 * @param start the lower bound of the range of contacts 240 * @param end the upper bound of the range of contacts (not inclusive) 241 * @return the range of contacts 242 */ 243 public static java.util.List<com.liferay.portal.model.Contact> getContacts( 244 int start, int end) { 245 return getService().getContacts(start, end); 246 } 247 248 /** 249 * Returns the number of contacts. 250 * 251 * @return the number of contacts 252 */ 253 public static int getContactsCount() { 254 return getService().getContactsCount(); 255 } 256 257 public static int getContactsCount(long classNameId, long classPK) { 258 return getService().getContactsCount(classNameId, classPK); 259 } 260 261 public static com.liferay.portal.model.PersistedModel getPersistedModel( 262 java.io.Serializable primaryKeyObj) 263 throws com.liferay.portal.kernel.exception.PortalException { 264 return getService().getPersistedModel(primaryKeyObj); 265 } 266 267 /** 268 * Sets the Spring bean ID for this bean. 269 * 270 * @param beanIdentifier the Spring bean ID for this bean 271 */ 272 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 273 getService().setBeanIdentifier(beanIdentifier); 274 } 275 276 /** 277 * Updates the contact in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 278 * 279 * @param contact the contact 280 * @return the contact that was updated 281 */ 282 public static com.liferay.portal.model.Contact updateContact( 283 com.liferay.portal.model.Contact contact) { 284 return getService().updateContact(contact); 285 } 286 287 public static com.liferay.portal.model.Contact updateContact( 288 long contactId, java.lang.String emailAddress, 289 java.lang.String firstName, java.lang.String middleName, 290 java.lang.String lastName, int prefixId, int suffixId, boolean male, 291 int birthdayMonth, int birthdayDay, int birthdayYear, 292 java.lang.String smsSn, java.lang.String aimSn, 293 java.lang.String facebookSn, java.lang.String icqSn, 294 java.lang.String jabberSn, java.lang.String msnSn, 295 java.lang.String mySpaceSn, java.lang.String skypeSn, 296 java.lang.String twitterSn, java.lang.String ymSn, 297 java.lang.String jobTitle) 298 throws com.liferay.portal.kernel.exception.PortalException { 299 return getService() 300 .updateContact(contactId, emailAddress, firstName, 301 middleName, lastName, prefixId, suffixId, male, birthdayMonth, 302 birthdayDay, birthdayYear, smsSn, aimSn, facebookSn, icqSn, 303 jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn, ymSn, jobTitle); 304 } 305 306 public static ContactLocalService getService() { 307 if (_service == null) { 308 _service = (ContactLocalService)PortalBeanLocatorUtil.locate(ContactLocalService.class.getName()); 309 310 ReferenceRegistry.registerReference(ContactLocalServiceUtil.class, 311 "_service"); 312 } 313 314 return _service; 315 } 316 317 /** 318 * @deprecated As of 6.2.0 319 */ 320 @Deprecated 321 public void setService(ContactLocalService service) { 322 } 323 324 private static ContactLocalService _service; 325 }