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, long prefixId, 059 long suffixId, boolean male, int birthdayMonth, int birthdayDay, 060 int birthdayYear, java.lang.String smsSn, java.lang.String facebookSn, 061 java.lang.String jabberSn, java.lang.String skypeSn, 062 java.lang.String twitterSn, java.lang.String jobTitle) 063 throws com.liferay.portal.kernel.exception.PortalException { 064 return getService() 065 .addContact(userId, className, classPK, emailAddress, 066 firstName, middleName, lastName, prefixId, suffixId, male, 067 birthdayMonth, birthdayDay, birthdayYear, smsSn, facebookSn, 068 jabberSn, skypeSn, twitterSn, jobTitle); 069 } 070 071 /** 072 * Creates a new contact with the primary key. Does not add the contact to the database. 073 * 074 * @param contactId the primary key for the new contact 075 * @return the new contact 076 */ 077 public static com.liferay.portal.model.Contact createContact(long contactId) { 078 return getService().createContact(contactId); 079 } 080 081 /** 082 * Deletes the contact from the database. Also notifies the appropriate model listeners. 083 * 084 * @param contact the contact 085 * @return the contact that was removed 086 */ 087 public static com.liferay.portal.model.Contact deleteContact( 088 com.liferay.portal.model.Contact contact) { 089 return getService().deleteContact(contact); 090 } 091 092 /** 093 * Deletes the contact with the primary key from the database. Also notifies the appropriate model listeners. 094 * 095 * @param contactId the primary key of the contact 096 * @return the contact that was removed 097 * @throws PortalException if a contact with the primary key could not be found 098 */ 099 public static com.liferay.portal.model.Contact deleteContact(long contactId) 100 throws com.liferay.portal.kernel.exception.PortalException { 101 return getService().deleteContact(contactId); 102 } 103 104 /** 105 * @throws PortalException 106 */ 107 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 108 com.liferay.portal.model.PersistedModel persistedModel) 109 throws com.liferay.portal.kernel.exception.PortalException { 110 return getService().deletePersistedModel(persistedModel); 111 } 112 113 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 114 return getService().dynamicQuery(); 115 } 116 117 /** 118 * Performs a dynamic query on the database and returns the matching rows. 119 * 120 * @param dynamicQuery the dynamic query 121 * @return the matching rows 122 */ 123 public static <T> java.util.List<T> dynamicQuery( 124 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 125 return getService().dynamicQuery(dynamicQuery); 126 } 127 128 /** 129 * Performs a dynamic query on the database and returns a range of the matching rows. 130 * 131 * <p> 132 * 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. 133 * </p> 134 * 135 * @param dynamicQuery the dynamic query 136 * @param start the lower bound of the range of model instances 137 * @param end the upper bound of the range of model instances (not inclusive) 138 * @return the range of matching rows 139 */ 140 public static <T> java.util.List<T> dynamicQuery( 141 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 142 int end) { 143 return getService().dynamicQuery(dynamicQuery, start, end); 144 } 145 146 /** 147 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 148 * 149 * <p> 150 * 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. 151 * </p> 152 * 153 * @param dynamicQuery the dynamic query 154 * @param start the lower bound of the range of model instances 155 * @param end the upper bound of the range of model instances (not inclusive) 156 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 157 * @return the ordered range of matching rows 158 */ 159 public static <T> java.util.List<T> dynamicQuery( 160 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 161 int end, 162 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 163 return getService() 164 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 165 } 166 167 /** 168 * Returns the number of rows matching the dynamic query. 169 * 170 * @param dynamicQuery the dynamic query 171 * @return the number of rows matching the dynamic query 172 */ 173 public static long dynamicQueryCount( 174 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 175 return getService().dynamicQueryCount(dynamicQuery); 176 } 177 178 /** 179 * Returns the number of rows matching the dynamic query. 180 * 181 * @param dynamicQuery the dynamic query 182 * @param projection the projection to apply to the query 183 * @return the number of rows matching the dynamic query 184 */ 185 public static long dynamicQueryCount( 186 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 187 com.liferay.portal.kernel.dao.orm.Projection projection) { 188 return getService().dynamicQueryCount(dynamicQuery, projection); 189 } 190 191 public static com.liferay.portal.model.Contact fetchContact(long contactId) { 192 return getService().fetchContact(contactId); 193 } 194 195 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 196 return getService().getActionableDynamicQuery(); 197 } 198 199 /** 200 * Returns the contact with the primary key. 201 * 202 * @param contactId the primary key of the contact 203 * @return the contact 204 * @throws PortalException if a contact with the primary key could not be found 205 */ 206 public static com.liferay.portal.model.Contact getContact(long contactId) 207 throws com.liferay.portal.kernel.exception.PortalException { 208 return getService().getContact(contactId); 209 } 210 211 public static java.util.List<com.liferay.portal.model.Contact> getContacts( 212 long classNameId, long classPK, int start, int end, 213 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Contact> orderByComparator) { 214 return getService() 215 .getContacts(classNameId, classPK, start, end, 216 orderByComparator); 217 } 218 219 /** 220 * Returns a range of all the contacts. 221 * 222 * <p> 223 * 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. 224 * </p> 225 * 226 * @param start the lower bound of the range of contacts 227 * @param end the upper bound of the range of contacts (not inclusive) 228 * @return the range of contacts 229 */ 230 public static java.util.List<com.liferay.portal.model.Contact> getContacts( 231 int start, int end) { 232 return getService().getContacts(start, end); 233 } 234 235 /** 236 * Returns the number of contacts. 237 * 238 * @return the number of contacts 239 */ 240 public static int getContactsCount() { 241 return getService().getContactsCount(); 242 } 243 244 public static int getContactsCount(long classNameId, long classPK) { 245 return getService().getContactsCount(classNameId, classPK); 246 } 247 248 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 249 return getService().getIndexableActionableDynamicQuery(); 250 } 251 252 /** 253 * Returns the OSGi service identifier. 254 * 255 * @return the OSGi service identifier 256 */ 257 public static java.lang.String getOSGiServiceIdentifier() { 258 return getService().getOSGiServiceIdentifier(); 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 * Updates the contact in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 269 * 270 * @param contact the contact 271 * @return the contact that was updated 272 */ 273 public static com.liferay.portal.model.Contact updateContact( 274 com.liferay.portal.model.Contact contact) { 275 return getService().updateContact(contact); 276 } 277 278 public static com.liferay.portal.model.Contact updateContact( 279 long contactId, java.lang.String emailAddress, 280 java.lang.String firstName, java.lang.String middleName, 281 java.lang.String lastName, long prefixId, long suffixId, boolean male, 282 int birthdayMonth, int birthdayDay, int birthdayYear, 283 java.lang.String smsSn, java.lang.String facebookSn, 284 java.lang.String jabberSn, java.lang.String skypeSn, 285 java.lang.String twitterSn, java.lang.String jobTitle) 286 throws com.liferay.portal.kernel.exception.PortalException { 287 return getService() 288 .updateContact(contactId, emailAddress, firstName, 289 middleName, lastName, prefixId, suffixId, male, birthdayMonth, 290 birthdayDay, birthdayYear, smsSn, facebookSn, jabberSn, skypeSn, 291 twitterSn, jobTitle); 292 } 293 294 public static ContactLocalService getService() { 295 if (_service == null) { 296 _service = (ContactLocalService)PortalBeanLocatorUtil.locate(ContactLocalService.class.getName()); 297 298 ReferenceRegistry.registerReference(ContactLocalServiceUtil.class, 299 "_service"); 300 } 301 302 return _service; 303 } 304 305 private static ContactLocalService _service; 306 }