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