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