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.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.model.Contact; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the contact service. This utility wraps {@link com.liferay.portal.service.persistence.impl.ContactPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see ContactPersistence 037 * @see com.liferay.portal.service.persistence.impl.ContactPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class ContactUtil { 042 /* 043 * NOTE FOR DEVELOPERS: 044 * 045 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 046 */ 047 048 /** 049 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 050 */ 051 public static void clearCache() { 052 getPersistence().clearCache(); 053 } 054 055 /** 056 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 057 */ 058 public static void clearCache(Contact contact) { 059 getPersistence().clearCache(contact); 060 } 061 062 /** 063 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 064 */ 065 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<Contact> findWithDynamicQuery(DynamicQuery dynamicQuery) { 073 return getPersistence().findWithDynamicQuery(dynamicQuery); 074 } 075 076 /** 077 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 078 */ 079 public static List<Contact> findWithDynamicQuery( 080 DynamicQuery dynamicQuery, int start, int end) { 081 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 082 } 083 084 /** 085 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 086 */ 087 public static List<Contact> findWithDynamicQuery( 088 DynamicQuery dynamicQuery, int start, int end, 089 OrderByComparator<Contact> orderByComparator) { 090 return getPersistence() 091 .findWithDynamicQuery(dynamicQuery, start, end, 092 orderByComparator); 093 } 094 095 /** 096 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 097 */ 098 public static Contact update(Contact contact) { 099 return getPersistence().update(contact); 100 } 101 102 /** 103 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 104 */ 105 public static Contact update(Contact contact, ServiceContext serviceContext) { 106 return getPersistence().update(contact, serviceContext); 107 } 108 109 /** 110 * Returns all the contacts where companyId = ?. 111 * 112 * @param companyId the company ID 113 * @return the matching contacts 114 */ 115 public static List<Contact> findByCompanyId(long companyId) { 116 return getPersistence().findByCompanyId(companyId); 117 } 118 119 /** 120 * Returns a range of all the contacts where companyId = ?. 121 * 122 * <p> 123 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 124 * </p> 125 * 126 * @param companyId the company ID 127 * @param start the lower bound of the range of contacts 128 * @param end the upper bound of the range of contacts (not inclusive) 129 * @return the range of matching contacts 130 */ 131 public static List<Contact> findByCompanyId(long companyId, int start, 132 int end) { 133 return getPersistence().findByCompanyId(companyId, start, end); 134 } 135 136 /** 137 * Returns an ordered range of all the contacts where companyId = ?. 138 * 139 * <p> 140 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 141 * </p> 142 * 143 * @param companyId the company ID 144 * @param start the lower bound of the range of contacts 145 * @param end the upper bound of the range of contacts (not inclusive) 146 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 147 * @return the ordered range of matching contacts 148 */ 149 public static List<Contact> findByCompanyId(long companyId, int start, 150 int end, OrderByComparator<Contact> orderByComparator) { 151 return getPersistence() 152 .findByCompanyId(companyId, start, end, orderByComparator); 153 } 154 155 /** 156 * Returns an ordered range of all the contacts where companyId = ?. 157 * 158 * <p> 159 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 160 * </p> 161 * 162 * @param companyId the company ID 163 * @param start the lower bound of the range of contacts 164 * @param end the upper bound of the range of contacts (not inclusive) 165 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 166 * @param retrieveFromCache whether to retrieve from the finder cache 167 * @return the ordered range of matching contacts 168 */ 169 public static List<Contact> findByCompanyId(long companyId, int start, 170 int end, OrderByComparator<Contact> orderByComparator, 171 boolean retrieveFromCache) { 172 return getPersistence() 173 .findByCompanyId(companyId, start, end, orderByComparator, 174 retrieveFromCache); 175 } 176 177 /** 178 * Returns the first contact in the ordered set where companyId = ?. 179 * 180 * @param companyId the company ID 181 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 182 * @return the first matching contact 183 * @throws NoSuchContactException if a matching contact could not be found 184 */ 185 public static Contact findByCompanyId_First(long companyId, 186 OrderByComparator<Contact> orderByComparator) 187 throws com.liferay.portal.exception.NoSuchContactException { 188 return getPersistence() 189 .findByCompanyId_First(companyId, orderByComparator); 190 } 191 192 /** 193 * Returns the first contact in the ordered set where companyId = ?. 194 * 195 * @param companyId the company ID 196 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 197 * @return the first matching contact, or <code>null</code> if a matching contact could not be found 198 */ 199 public static Contact fetchByCompanyId_First(long companyId, 200 OrderByComparator<Contact> orderByComparator) { 201 return getPersistence() 202 .fetchByCompanyId_First(companyId, orderByComparator); 203 } 204 205 /** 206 * Returns the last contact in the ordered set where companyId = ?. 207 * 208 * @param companyId the company ID 209 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 210 * @return the last matching contact 211 * @throws NoSuchContactException if a matching contact could not be found 212 */ 213 public static Contact findByCompanyId_Last(long companyId, 214 OrderByComparator<Contact> orderByComparator) 215 throws com.liferay.portal.exception.NoSuchContactException { 216 return getPersistence() 217 .findByCompanyId_Last(companyId, orderByComparator); 218 } 219 220 /** 221 * Returns the last contact in the ordered set where companyId = ?. 222 * 223 * @param companyId the company ID 224 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 225 * @return the last matching contact, or <code>null</code> if a matching contact could not be found 226 */ 227 public static Contact fetchByCompanyId_Last(long companyId, 228 OrderByComparator<Contact> orderByComparator) { 229 return getPersistence() 230 .fetchByCompanyId_Last(companyId, orderByComparator); 231 } 232 233 /** 234 * Returns the contacts before and after the current contact in the ordered set where companyId = ?. 235 * 236 * @param contactId the primary key of the current contact 237 * @param companyId the company ID 238 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 239 * @return the previous, current, and next contact 240 * @throws NoSuchContactException if a contact with the primary key could not be found 241 */ 242 public static Contact[] findByCompanyId_PrevAndNext(long contactId, 243 long companyId, OrderByComparator<Contact> orderByComparator) 244 throws com.liferay.portal.exception.NoSuchContactException { 245 return getPersistence() 246 .findByCompanyId_PrevAndNext(contactId, companyId, 247 orderByComparator); 248 } 249 250 /** 251 * Removes all the contacts where companyId = ? from the database. 252 * 253 * @param companyId the company ID 254 */ 255 public static void removeByCompanyId(long companyId) { 256 getPersistence().removeByCompanyId(companyId); 257 } 258 259 /** 260 * Returns the number of contacts where companyId = ?. 261 * 262 * @param companyId the company ID 263 * @return the number of matching contacts 264 */ 265 public static int countByCompanyId(long companyId) { 266 return getPersistence().countByCompanyId(companyId); 267 } 268 269 /** 270 * Returns all the contacts where accountId = ?. 271 * 272 * @param accountId the account ID 273 * @return the matching contacts 274 */ 275 public static List<Contact> findByAccountId(long accountId) { 276 return getPersistence().findByAccountId(accountId); 277 } 278 279 /** 280 * Returns a range of all the contacts where accountId = ?. 281 * 282 * <p> 283 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 284 * </p> 285 * 286 * @param accountId the account ID 287 * @param start the lower bound of the range of contacts 288 * @param end the upper bound of the range of contacts (not inclusive) 289 * @return the range of matching contacts 290 */ 291 public static List<Contact> findByAccountId(long accountId, int start, 292 int end) { 293 return getPersistence().findByAccountId(accountId, start, end); 294 } 295 296 /** 297 * Returns an ordered range of all the contacts where accountId = ?. 298 * 299 * <p> 300 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 301 * </p> 302 * 303 * @param accountId the account ID 304 * @param start the lower bound of the range of contacts 305 * @param end the upper bound of the range of contacts (not inclusive) 306 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 307 * @return the ordered range of matching contacts 308 */ 309 public static List<Contact> findByAccountId(long accountId, int start, 310 int end, OrderByComparator<Contact> orderByComparator) { 311 return getPersistence() 312 .findByAccountId(accountId, start, end, orderByComparator); 313 } 314 315 /** 316 * Returns an ordered range of all the contacts where accountId = ?. 317 * 318 * <p> 319 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 320 * </p> 321 * 322 * @param accountId the account ID 323 * @param start the lower bound of the range of contacts 324 * @param end the upper bound of the range of contacts (not inclusive) 325 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 326 * @param retrieveFromCache whether to retrieve from the finder cache 327 * @return the ordered range of matching contacts 328 */ 329 public static List<Contact> findByAccountId(long accountId, int start, 330 int end, OrderByComparator<Contact> orderByComparator, 331 boolean retrieveFromCache) { 332 return getPersistence() 333 .findByAccountId(accountId, start, end, orderByComparator, 334 retrieveFromCache); 335 } 336 337 /** 338 * Returns the first contact in the ordered set where accountId = ?. 339 * 340 * @param accountId the account ID 341 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 342 * @return the first matching contact 343 * @throws NoSuchContactException if a matching contact could not be found 344 */ 345 public static Contact findByAccountId_First(long accountId, 346 OrderByComparator<Contact> orderByComparator) 347 throws com.liferay.portal.exception.NoSuchContactException { 348 return getPersistence() 349 .findByAccountId_First(accountId, orderByComparator); 350 } 351 352 /** 353 * Returns the first contact in the ordered set where accountId = ?. 354 * 355 * @param accountId the account ID 356 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 357 * @return the first matching contact, or <code>null</code> if a matching contact could not be found 358 */ 359 public static Contact fetchByAccountId_First(long accountId, 360 OrderByComparator<Contact> orderByComparator) { 361 return getPersistence() 362 .fetchByAccountId_First(accountId, orderByComparator); 363 } 364 365 /** 366 * Returns the last contact in the ordered set where accountId = ?. 367 * 368 * @param accountId the account ID 369 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 370 * @return the last matching contact 371 * @throws NoSuchContactException if a matching contact could not be found 372 */ 373 public static Contact findByAccountId_Last(long accountId, 374 OrderByComparator<Contact> orderByComparator) 375 throws com.liferay.portal.exception.NoSuchContactException { 376 return getPersistence() 377 .findByAccountId_Last(accountId, orderByComparator); 378 } 379 380 /** 381 * Returns the last contact in the ordered set where accountId = ?. 382 * 383 * @param accountId the account ID 384 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 385 * @return the last matching contact, or <code>null</code> if a matching contact could not be found 386 */ 387 public static Contact fetchByAccountId_Last(long accountId, 388 OrderByComparator<Contact> orderByComparator) { 389 return getPersistence() 390 .fetchByAccountId_Last(accountId, orderByComparator); 391 } 392 393 /** 394 * Returns the contacts before and after the current contact in the ordered set where accountId = ?. 395 * 396 * @param contactId the primary key of the current contact 397 * @param accountId the account ID 398 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 399 * @return the previous, current, and next contact 400 * @throws NoSuchContactException if a contact with the primary key could not be found 401 */ 402 public static Contact[] findByAccountId_PrevAndNext(long contactId, 403 long accountId, OrderByComparator<Contact> orderByComparator) 404 throws com.liferay.portal.exception.NoSuchContactException { 405 return getPersistence() 406 .findByAccountId_PrevAndNext(contactId, accountId, 407 orderByComparator); 408 } 409 410 /** 411 * Removes all the contacts where accountId = ? from the database. 412 * 413 * @param accountId the account ID 414 */ 415 public static void removeByAccountId(long accountId) { 416 getPersistence().removeByAccountId(accountId); 417 } 418 419 /** 420 * Returns the number of contacts where accountId = ?. 421 * 422 * @param accountId the account ID 423 * @return the number of matching contacts 424 */ 425 public static int countByAccountId(long accountId) { 426 return getPersistence().countByAccountId(accountId); 427 } 428 429 /** 430 * Returns all the contacts where classNameId = ? and classPK = ?. 431 * 432 * @param classNameId the class name ID 433 * @param classPK the class p k 434 * @return the matching contacts 435 */ 436 public static List<Contact> findByC_C(long classNameId, long classPK) { 437 return getPersistence().findByC_C(classNameId, classPK); 438 } 439 440 /** 441 * Returns a range of all the contacts where classNameId = ? and classPK = ?. 442 * 443 * <p> 444 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 445 * </p> 446 * 447 * @param classNameId the class name ID 448 * @param classPK the class p k 449 * @param start the lower bound of the range of contacts 450 * @param end the upper bound of the range of contacts (not inclusive) 451 * @return the range of matching contacts 452 */ 453 public static List<Contact> findByC_C(long classNameId, long classPK, 454 int start, int end) { 455 return getPersistence().findByC_C(classNameId, classPK, start, end); 456 } 457 458 /** 459 * Returns an ordered range of all the contacts where classNameId = ? and classPK = ?. 460 * 461 * <p> 462 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 463 * </p> 464 * 465 * @param classNameId the class name ID 466 * @param classPK the class p k 467 * @param start the lower bound of the range of contacts 468 * @param end the upper bound of the range of contacts (not inclusive) 469 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 470 * @return the ordered range of matching contacts 471 */ 472 public static List<Contact> findByC_C(long classNameId, long classPK, 473 int start, int end, OrderByComparator<Contact> orderByComparator) { 474 return getPersistence() 475 .findByC_C(classNameId, classPK, start, end, 476 orderByComparator); 477 } 478 479 /** 480 * Returns an ordered range of all the contacts where classNameId = ? and classPK = ?. 481 * 482 * <p> 483 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 484 * </p> 485 * 486 * @param classNameId the class name ID 487 * @param classPK the class p k 488 * @param start the lower bound of the range of contacts 489 * @param end the upper bound of the range of contacts (not inclusive) 490 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 491 * @param retrieveFromCache whether to retrieve from the finder cache 492 * @return the ordered range of matching contacts 493 */ 494 public static List<Contact> findByC_C(long classNameId, long classPK, 495 int start, int end, OrderByComparator<Contact> orderByComparator, 496 boolean retrieveFromCache) { 497 return getPersistence() 498 .findByC_C(classNameId, classPK, start, end, 499 orderByComparator, retrieveFromCache); 500 } 501 502 /** 503 * Returns the first contact in the ordered set where classNameId = ? and classPK = ?. 504 * 505 * @param classNameId the class name ID 506 * @param classPK the class p k 507 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 508 * @return the first matching contact 509 * @throws NoSuchContactException if a matching contact could not be found 510 */ 511 public static Contact findByC_C_First(long classNameId, long classPK, 512 OrderByComparator<Contact> orderByComparator) 513 throws com.liferay.portal.exception.NoSuchContactException { 514 return getPersistence() 515 .findByC_C_First(classNameId, classPK, orderByComparator); 516 } 517 518 /** 519 * Returns the first contact in the ordered set where classNameId = ? and classPK = ?. 520 * 521 * @param classNameId the class name ID 522 * @param classPK the class p k 523 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 524 * @return the first matching contact, or <code>null</code> if a matching contact could not be found 525 */ 526 public static Contact fetchByC_C_First(long classNameId, long classPK, 527 OrderByComparator<Contact> orderByComparator) { 528 return getPersistence() 529 .fetchByC_C_First(classNameId, classPK, orderByComparator); 530 } 531 532 /** 533 * Returns the last contact in the ordered set where classNameId = ? and classPK = ?. 534 * 535 * @param classNameId the class name ID 536 * @param classPK the class p k 537 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 538 * @return the last matching contact 539 * @throws NoSuchContactException if a matching contact could not be found 540 */ 541 public static Contact findByC_C_Last(long classNameId, long classPK, 542 OrderByComparator<Contact> orderByComparator) 543 throws com.liferay.portal.exception.NoSuchContactException { 544 return getPersistence() 545 .findByC_C_Last(classNameId, classPK, orderByComparator); 546 } 547 548 /** 549 * Returns the last contact in the ordered set where classNameId = ? and classPK = ?. 550 * 551 * @param classNameId the class name ID 552 * @param classPK the class p k 553 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 554 * @return the last matching contact, or <code>null</code> if a matching contact could not be found 555 */ 556 public static Contact fetchByC_C_Last(long classNameId, long classPK, 557 OrderByComparator<Contact> orderByComparator) { 558 return getPersistence() 559 .fetchByC_C_Last(classNameId, classPK, orderByComparator); 560 } 561 562 /** 563 * Returns the contacts before and after the current contact in the ordered set where classNameId = ? and classPK = ?. 564 * 565 * @param contactId the primary key of the current contact 566 * @param classNameId the class name ID 567 * @param classPK the class p k 568 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 569 * @return the previous, current, and next contact 570 * @throws NoSuchContactException if a contact with the primary key could not be found 571 */ 572 public static Contact[] findByC_C_PrevAndNext(long contactId, 573 long classNameId, long classPK, 574 OrderByComparator<Contact> orderByComparator) 575 throws com.liferay.portal.exception.NoSuchContactException { 576 return getPersistence() 577 .findByC_C_PrevAndNext(contactId, classNameId, classPK, 578 orderByComparator); 579 } 580 581 /** 582 * Removes all the contacts where classNameId = ? and classPK = ? from the database. 583 * 584 * @param classNameId the class name ID 585 * @param classPK the class p k 586 */ 587 public static void removeByC_C(long classNameId, long classPK) { 588 getPersistence().removeByC_C(classNameId, classPK); 589 } 590 591 /** 592 * Returns the number of contacts where classNameId = ? and classPK = ?. 593 * 594 * @param classNameId the class name ID 595 * @param classPK the class p k 596 * @return the number of matching contacts 597 */ 598 public static int countByC_C(long classNameId, long classPK) { 599 return getPersistence().countByC_C(classNameId, classPK); 600 } 601 602 /** 603 * Caches the contact in the entity cache if it is enabled. 604 * 605 * @param contact the contact 606 */ 607 public static void cacheResult(Contact contact) { 608 getPersistence().cacheResult(contact); 609 } 610 611 /** 612 * Caches the contacts in the entity cache if it is enabled. 613 * 614 * @param contacts the contacts 615 */ 616 public static void cacheResult(List<Contact> contacts) { 617 getPersistence().cacheResult(contacts); 618 } 619 620 /** 621 * Creates a new contact with the primary key. Does not add the contact to the database. 622 * 623 * @param contactId the primary key for the new contact 624 * @return the new contact 625 */ 626 public static Contact create(long contactId) { 627 return getPersistence().create(contactId); 628 } 629 630 /** 631 * Removes the contact with the primary key from the database. Also notifies the appropriate model listeners. 632 * 633 * @param contactId the primary key of the contact 634 * @return the contact that was removed 635 * @throws NoSuchContactException if a contact with the primary key could not be found 636 */ 637 public static Contact remove(long contactId) 638 throws com.liferay.portal.exception.NoSuchContactException { 639 return getPersistence().remove(contactId); 640 } 641 642 public static Contact updateImpl(Contact contact) { 643 return getPersistence().updateImpl(contact); 644 } 645 646 /** 647 * Returns the contact with the primary key or throws a {@link NoSuchContactException} if it could not be found. 648 * 649 * @param contactId the primary key of the contact 650 * @return the contact 651 * @throws NoSuchContactException if a contact with the primary key could not be found 652 */ 653 public static Contact findByPrimaryKey(long contactId) 654 throws com.liferay.portal.exception.NoSuchContactException { 655 return getPersistence().findByPrimaryKey(contactId); 656 } 657 658 /** 659 * Returns the contact with the primary key or returns <code>null</code> if it could not be found. 660 * 661 * @param contactId the primary key of the contact 662 * @return the contact, or <code>null</code> if a contact with the primary key could not be found 663 */ 664 public static Contact fetchByPrimaryKey(long contactId) { 665 return getPersistence().fetchByPrimaryKey(contactId); 666 } 667 668 public static java.util.Map<java.io.Serializable, Contact> fetchByPrimaryKeys( 669 java.util.Set<java.io.Serializable> primaryKeys) { 670 return getPersistence().fetchByPrimaryKeys(primaryKeys); 671 } 672 673 /** 674 * Returns all the contacts. 675 * 676 * @return the contacts 677 */ 678 public static List<Contact> findAll() { 679 return getPersistence().findAll(); 680 } 681 682 /** 683 * Returns a range of all the contacts. 684 * 685 * <p> 686 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 687 * </p> 688 * 689 * @param start the lower bound of the range of contacts 690 * @param end the upper bound of the range of contacts (not inclusive) 691 * @return the range of contacts 692 */ 693 public static List<Contact> findAll(int start, int end) { 694 return getPersistence().findAll(start, end); 695 } 696 697 /** 698 * Returns an ordered range of all the contacts. 699 * 700 * <p> 701 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 702 * </p> 703 * 704 * @param start the lower bound of the range of contacts 705 * @param end the upper bound of the range of contacts (not inclusive) 706 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 707 * @return the ordered range of contacts 708 */ 709 public static List<Contact> findAll(int start, int end, 710 OrderByComparator<Contact> orderByComparator) { 711 return getPersistence().findAll(start, end, orderByComparator); 712 } 713 714 /** 715 * Returns an ordered range of all the contacts. 716 * 717 * <p> 718 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 719 * </p> 720 * 721 * @param start the lower bound of the range of contacts 722 * @param end the upper bound of the range of contacts (not inclusive) 723 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 724 * @param retrieveFromCache whether to retrieve from the finder cache 725 * @return the ordered range of contacts 726 */ 727 public static List<Contact> findAll(int start, int end, 728 OrderByComparator<Contact> orderByComparator, boolean retrieveFromCache) { 729 return getPersistence() 730 .findAll(start, end, orderByComparator, retrieveFromCache); 731 } 732 733 /** 734 * Removes all the contacts from the database. 735 */ 736 public static void removeAll() { 737 getPersistence().removeAll(); 738 } 739 740 /** 741 * Returns the number of contacts. 742 * 743 * @return the number of contacts 744 */ 745 public static int countAll() { 746 return getPersistence().countAll(); 747 } 748 749 public static ContactPersistence getPersistence() { 750 if (_persistence == null) { 751 _persistence = (ContactPersistence)PortalBeanLocatorUtil.locate(ContactPersistence.class.getName()); 752 753 ReferenceRegistry.registerReference(ContactUtil.class, 754 "_persistence"); 755 } 756 757 return _persistence; 758 } 759 760 private static ContactPersistence _persistence; 761 }