001 /** 002 * Copyright (c) 2000-2013 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.Company; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the company service. This utility wraps {@link CompanyPersistenceImpl} 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 CompanyPersistence 036 * @see CompanyPersistenceImpl 037 * @generated 038 */ 039 public class CompanyUtil { 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(Company company) { 057 getPersistence().clearCache(company); 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<Company> 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<Company> 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<Company> 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, boolean) 098 */ 099 public static Company update(Company company, boolean merge) 100 throws SystemException { 101 return getPersistence().update(company, merge); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 106 */ 107 public static Company update(Company company, boolean merge, 108 ServiceContext serviceContext) throws SystemException { 109 return getPersistence().update(company, merge, serviceContext); 110 } 111 112 /** 113 * Caches the company in the entity cache if it is enabled. 114 * 115 * @param company the company 116 */ 117 public static void cacheResult(com.liferay.portal.model.Company company) { 118 getPersistence().cacheResult(company); 119 } 120 121 /** 122 * Caches the companies in the entity cache if it is enabled. 123 * 124 * @param companies the companies 125 */ 126 public static void cacheResult( 127 java.util.List<com.liferay.portal.model.Company> companies) { 128 getPersistence().cacheResult(companies); 129 } 130 131 /** 132 * Creates a new company with the primary key. Does not add the company to the database. 133 * 134 * @param companyId the primary key for the new company 135 * @return the new company 136 */ 137 public static com.liferay.portal.model.Company create(long companyId) { 138 return getPersistence().create(companyId); 139 } 140 141 /** 142 * Removes the company with the primary key from the database. Also notifies the appropriate model listeners. 143 * 144 * @param companyId the primary key of the company 145 * @return the company that was removed 146 * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found 147 * @throws SystemException if a system exception occurred 148 */ 149 public static com.liferay.portal.model.Company remove(long companyId) 150 throws com.liferay.portal.NoSuchCompanyException, 151 com.liferay.portal.kernel.exception.SystemException { 152 return getPersistence().remove(companyId); 153 } 154 155 public static com.liferay.portal.model.Company updateImpl( 156 com.liferay.portal.model.Company company, boolean merge) 157 throws com.liferay.portal.kernel.exception.SystemException { 158 return getPersistence().updateImpl(company, merge); 159 } 160 161 /** 162 * Returns the company with the primary key or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found. 163 * 164 * @param companyId the primary key of the company 165 * @return the company 166 * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found 167 * @throws SystemException if a system exception occurred 168 */ 169 public static com.liferay.portal.model.Company findByPrimaryKey( 170 long companyId) 171 throws com.liferay.portal.NoSuchCompanyException, 172 com.liferay.portal.kernel.exception.SystemException { 173 return getPersistence().findByPrimaryKey(companyId); 174 } 175 176 /** 177 * Returns the company with the primary key or returns <code>null</code> if it could not be found. 178 * 179 * @param companyId the primary key of the company 180 * @return the company, or <code>null</code> if a company with the primary key could not be found 181 * @throws SystemException if a system exception occurred 182 */ 183 public static com.liferay.portal.model.Company fetchByPrimaryKey( 184 long companyId) 185 throws com.liferay.portal.kernel.exception.SystemException { 186 return getPersistence().fetchByPrimaryKey(companyId); 187 } 188 189 /** 190 * Returns the company where webId = ? or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found. 191 * 192 * @param webId the web ID 193 * @return the matching company 194 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 195 * @throws SystemException if a system exception occurred 196 */ 197 public static com.liferay.portal.model.Company findByWebId( 198 java.lang.String webId) 199 throws com.liferay.portal.NoSuchCompanyException, 200 com.liferay.portal.kernel.exception.SystemException { 201 return getPersistence().findByWebId(webId); 202 } 203 204 /** 205 * Returns the company where webId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 206 * 207 * @param webId the web ID 208 * @return the matching company, or <code>null</code> if a matching company could not be found 209 * @throws SystemException if a system exception occurred 210 */ 211 public static com.liferay.portal.model.Company fetchByWebId( 212 java.lang.String webId) 213 throws com.liferay.portal.kernel.exception.SystemException { 214 return getPersistence().fetchByWebId(webId); 215 } 216 217 /** 218 * Returns the company where webId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 219 * 220 * @param webId the web ID 221 * @param retrieveFromCache whether to use the finder cache 222 * @return the matching company, or <code>null</code> if a matching company could not be found 223 * @throws SystemException if a system exception occurred 224 */ 225 public static com.liferay.portal.model.Company fetchByWebId( 226 java.lang.String webId, boolean retrieveFromCache) 227 throws com.liferay.portal.kernel.exception.SystemException { 228 return getPersistence().fetchByWebId(webId, retrieveFromCache); 229 } 230 231 /** 232 * Returns the company where mx = ? or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found. 233 * 234 * @param mx the mx 235 * @return the matching company 236 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 237 * @throws SystemException if a system exception occurred 238 */ 239 public static com.liferay.portal.model.Company findByMx(java.lang.String mx) 240 throws com.liferay.portal.NoSuchCompanyException, 241 com.liferay.portal.kernel.exception.SystemException { 242 return getPersistence().findByMx(mx); 243 } 244 245 /** 246 * Returns the company where mx = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 247 * 248 * @param mx the mx 249 * @return the matching company, or <code>null</code> if a matching company could not be found 250 * @throws SystemException if a system exception occurred 251 */ 252 public static com.liferay.portal.model.Company fetchByMx( 253 java.lang.String mx) 254 throws com.liferay.portal.kernel.exception.SystemException { 255 return getPersistence().fetchByMx(mx); 256 } 257 258 /** 259 * Returns the company where mx = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 260 * 261 * @param mx the mx 262 * @param retrieveFromCache whether to use the finder cache 263 * @return the matching company, or <code>null</code> if a matching company could not be found 264 * @throws SystemException if a system exception occurred 265 */ 266 public static com.liferay.portal.model.Company fetchByMx( 267 java.lang.String mx, boolean retrieveFromCache) 268 throws com.liferay.portal.kernel.exception.SystemException { 269 return getPersistence().fetchByMx(mx, retrieveFromCache); 270 } 271 272 /** 273 * Returns the company where logoId = ? or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found. 274 * 275 * @param logoId the logo ID 276 * @return the matching company 277 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 278 * @throws SystemException if a system exception occurred 279 */ 280 public static com.liferay.portal.model.Company findByLogoId(long logoId) 281 throws com.liferay.portal.NoSuchCompanyException, 282 com.liferay.portal.kernel.exception.SystemException { 283 return getPersistence().findByLogoId(logoId); 284 } 285 286 /** 287 * Returns the company where logoId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 288 * 289 * @param logoId the logo ID 290 * @return the matching company, or <code>null</code> if a matching company could not be found 291 * @throws SystemException if a system exception occurred 292 */ 293 public static com.liferay.portal.model.Company fetchByLogoId(long logoId) 294 throws com.liferay.portal.kernel.exception.SystemException { 295 return getPersistence().fetchByLogoId(logoId); 296 } 297 298 /** 299 * Returns the company where logoId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 300 * 301 * @param logoId the logo ID 302 * @param retrieveFromCache whether to use the finder cache 303 * @return the matching company, or <code>null</code> if a matching company could not be found 304 * @throws SystemException if a system exception occurred 305 */ 306 public static com.liferay.portal.model.Company fetchByLogoId(long logoId, 307 boolean retrieveFromCache) 308 throws com.liferay.portal.kernel.exception.SystemException { 309 return getPersistence().fetchByLogoId(logoId, retrieveFromCache); 310 } 311 312 /** 313 * Returns all the companies where system = ?. 314 * 315 * @param system the system 316 * @return the matching companies 317 * @throws SystemException if a system exception occurred 318 */ 319 public static java.util.List<com.liferay.portal.model.Company> findBySystem( 320 boolean system) 321 throws com.liferay.portal.kernel.exception.SystemException { 322 return getPersistence().findBySystem(system); 323 } 324 325 /** 326 * Returns a range of all the companies where system = ?. 327 * 328 * <p> 329 * 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. 330 * </p> 331 * 332 * @param system the system 333 * @param start the lower bound of the range of companies 334 * @param end the upper bound of the range of companies (not inclusive) 335 * @return the range of matching companies 336 * @throws SystemException if a system exception occurred 337 */ 338 public static java.util.List<com.liferay.portal.model.Company> findBySystem( 339 boolean system, int start, int end) 340 throws com.liferay.portal.kernel.exception.SystemException { 341 return getPersistence().findBySystem(system, start, end); 342 } 343 344 /** 345 * Returns an ordered range of all the companies where system = ?. 346 * 347 * <p> 348 * 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. 349 * </p> 350 * 351 * @param system the system 352 * @param start the lower bound of the range of companies 353 * @param end the upper bound of the range of companies (not inclusive) 354 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 355 * @return the ordered range of matching companies 356 * @throws SystemException if a system exception occurred 357 */ 358 public static java.util.List<com.liferay.portal.model.Company> findBySystem( 359 boolean system, int start, int end, 360 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 361 throws com.liferay.portal.kernel.exception.SystemException { 362 return getPersistence() 363 .findBySystem(system, start, end, orderByComparator); 364 } 365 366 /** 367 * Returns the first company in the ordered set where system = ?. 368 * 369 * @param system the system 370 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 371 * @return the first matching company 372 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 373 * @throws SystemException if a system exception occurred 374 */ 375 public static com.liferay.portal.model.Company findBySystem_First( 376 boolean system, 377 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 378 throws com.liferay.portal.NoSuchCompanyException, 379 com.liferay.portal.kernel.exception.SystemException { 380 return getPersistence().findBySystem_First(system, orderByComparator); 381 } 382 383 /** 384 * Returns the first company in the ordered set where system = ?. 385 * 386 * @param system the system 387 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 388 * @return the first matching company, or <code>null</code> if a matching company could not be found 389 * @throws SystemException if a system exception occurred 390 */ 391 public static com.liferay.portal.model.Company fetchBySystem_First( 392 boolean system, 393 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 394 throws com.liferay.portal.kernel.exception.SystemException { 395 return getPersistence().fetchBySystem_First(system, orderByComparator); 396 } 397 398 /** 399 * Returns the last company in the ordered set where system = ?. 400 * 401 * @param system the system 402 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 403 * @return the last matching company 404 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 405 * @throws SystemException if a system exception occurred 406 */ 407 public static com.liferay.portal.model.Company findBySystem_Last( 408 boolean system, 409 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 410 throws com.liferay.portal.NoSuchCompanyException, 411 com.liferay.portal.kernel.exception.SystemException { 412 return getPersistence().findBySystem_Last(system, orderByComparator); 413 } 414 415 /** 416 * Returns the last company in the ordered set where system = ?. 417 * 418 * @param system the system 419 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 420 * @return the last matching company, or <code>null</code> if a matching company could not be found 421 * @throws SystemException if a system exception occurred 422 */ 423 public static com.liferay.portal.model.Company fetchBySystem_Last( 424 boolean system, 425 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 426 throws com.liferay.portal.kernel.exception.SystemException { 427 return getPersistence().fetchBySystem_Last(system, orderByComparator); 428 } 429 430 /** 431 * Returns the companies before and after the current company in the ordered set where system = ?. 432 * 433 * @param companyId the primary key of the current company 434 * @param system the system 435 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 436 * @return the previous, current, and next company 437 * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found 438 * @throws SystemException if a system exception occurred 439 */ 440 public static com.liferay.portal.model.Company[] findBySystem_PrevAndNext( 441 long companyId, boolean system, 442 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 443 throws com.liferay.portal.NoSuchCompanyException, 444 com.liferay.portal.kernel.exception.SystemException { 445 return getPersistence() 446 .findBySystem_PrevAndNext(companyId, system, 447 orderByComparator); 448 } 449 450 /** 451 * Returns all the companies. 452 * 453 * @return the companies 454 * @throws SystemException if a system exception occurred 455 */ 456 public static java.util.List<com.liferay.portal.model.Company> findAll() 457 throws com.liferay.portal.kernel.exception.SystemException { 458 return getPersistence().findAll(); 459 } 460 461 /** 462 * Returns a range of all the companies. 463 * 464 * <p> 465 * 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. 466 * </p> 467 * 468 * @param start the lower bound of the range of companies 469 * @param end the upper bound of the range of companies (not inclusive) 470 * @return the range of companies 471 * @throws SystemException if a system exception occurred 472 */ 473 public static java.util.List<com.liferay.portal.model.Company> findAll( 474 int start, int end) 475 throws com.liferay.portal.kernel.exception.SystemException { 476 return getPersistence().findAll(start, end); 477 } 478 479 /** 480 * Returns an ordered range of all the companies. 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 484 * </p> 485 * 486 * @param start the lower bound of the range of companies 487 * @param end the upper bound of the range of companies (not inclusive) 488 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 489 * @return the ordered range of companies 490 * @throws SystemException if a system exception occurred 491 */ 492 public static java.util.List<com.liferay.portal.model.Company> findAll( 493 int start, int end, 494 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 495 throws com.liferay.portal.kernel.exception.SystemException { 496 return getPersistence().findAll(start, end, orderByComparator); 497 } 498 499 /** 500 * Removes the company where webId = ? from the database. 501 * 502 * @param webId the web ID 503 * @return the company that was removed 504 * @throws SystemException if a system exception occurred 505 */ 506 public static com.liferay.portal.model.Company removeByWebId( 507 java.lang.String webId) 508 throws com.liferay.portal.NoSuchCompanyException, 509 com.liferay.portal.kernel.exception.SystemException { 510 return getPersistence().removeByWebId(webId); 511 } 512 513 /** 514 * Removes the company where mx = ? from the database. 515 * 516 * @param mx the mx 517 * @return the company that was removed 518 * @throws SystemException if a system exception occurred 519 */ 520 public static com.liferay.portal.model.Company removeByMx( 521 java.lang.String mx) 522 throws com.liferay.portal.NoSuchCompanyException, 523 com.liferay.portal.kernel.exception.SystemException { 524 return getPersistence().removeByMx(mx); 525 } 526 527 /** 528 * Removes the company where logoId = ? from the database. 529 * 530 * @param logoId the logo ID 531 * @return the company that was removed 532 * @throws SystemException if a system exception occurred 533 */ 534 public static com.liferay.portal.model.Company removeByLogoId(long logoId) 535 throws com.liferay.portal.NoSuchCompanyException, 536 com.liferay.portal.kernel.exception.SystemException { 537 return getPersistence().removeByLogoId(logoId); 538 } 539 540 /** 541 * Removes all the companies where system = ? from the database. 542 * 543 * @param system the system 544 * @throws SystemException if a system exception occurred 545 */ 546 public static void removeBySystem(boolean system) 547 throws com.liferay.portal.kernel.exception.SystemException { 548 getPersistence().removeBySystem(system); 549 } 550 551 /** 552 * Removes all the companies from the database. 553 * 554 * @throws SystemException if a system exception occurred 555 */ 556 public static void removeAll() 557 throws com.liferay.portal.kernel.exception.SystemException { 558 getPersistence().removeAll(); 559 } 560 561 /** 562 * Returns the number of companies where webId = ?. 563 * 564 * @param webId the web ID 565 * @return the number of matching companies 566 * @throws SystemException if a system exception occurred 567 */ 568 public static int countByWebId(java.lang.String webId) 569 throws com.liferay.portal.kernel.exception.SystemException { 570 return getPersistence().countByWebId(webId); 571 } 572 573 /** 574 * Returns the number of companies where mx = ?. 575 * 576 * @param mx the mx 577 * @return the number of matching companies 578 * @throws SystemException if a system exception occurred 579 */ 580 public static int countByMx(java.lang.String mx) 581 throws com.liferay.portal.kernel.exception.SystemException { 582 return getPersistence().countByMx(mx); 583 } 584 585 /** 586 * Returns the number of companies where logoId = ?. 587 * 588 * @param logoId the logo ID 589 * @return the number of matching companies 590 * @throws SystemException if a system exception occurred 591 */ 592 public static int countByLogoId(long logoId) 593 throws com.liferay.portal.kernel.exception.SystemException { 594 return getPersistence().countByLogoId(logoId); 595 } 596 597 /** 598 * Returns the number of companies where system = ?. 599 * 600 * @param system the system 601 * @return the number of matching companies 602 * @throws SystemException if a system exception occurred 603 */ 604 public static int countBySystem(boolean system) 605 throws com.liferay.portal.kernel.exception.SystemException { 606 return getPersistence().countBySystem(system); 607 } 608 609 /** 610 * Returns the number of companies. 611 * 612 * @return the number of companies 613 * @throws SystemException if a system exception occurred 614 */ 615 public static int countAll() 616 throws com.liferay.portal.kernel.exception.SystemException { 617 return getPersistence().countAll(); 618 } 619 620 public static CompanyPersistence getPersistence() { 621 if (_persistence == null) { 622 _persistence = (CompanyPersistence)PortalBeanLocatorUtil.locate(CompanyPersistence.class.getName()); 623 624 ReferenceRegistry.registerReference(CompanyUtil.class, 625 "_persistence"); 626 } 627 628 return _persistence; 629 } 630 631 /** 632 * @deprecated 633 */ 634 public void setPersistence(CompanyPersistence persistence) { 635 } 636 637 private static CompanyPersistence _persistence; 638 }