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