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