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.OrgLabor; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the org labor service. This utility wraps {@link com.liferay.portal.service.persistence.impl.OrgLaborPersistenceImpl} 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 OrgLaborPersistence 037 * @see com.liferay.portal.service.persistence.impl.OrgLaborPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class OrgLaborUtil { 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(OrgLabor orgLabor) { 059 getPersistence().clearCache(orgLabor); 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<OrgLabor> 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<OrgLabor> 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<OrgLabor> findWithDynamicQuery( 088 DynamicQuery dynamicQuery, int start, int end, 089 OrderByComparator<OrgLabor> 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 OrgLabor update(OrgLabor orgLabor) { 099 return getPersistence().update(orgLabor); 100 } 101 102 /** 103 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 104 */ 105 public static OrgLabor update(OrgLabor orgLabor, 106 ServiceContext serviceContext) { 107 return getPersistence().update(orgLabor, serviceContext); 108 } 109 110 /** 111 * Returns all the org labors where organizationId = ?. 112 * 113 * @param organizationId the organization ID 114 * @return the matching org labors 115 */ 116 public static List<OrgLabor> findByOrganizationId(long organizationId) { 117 return getPersistence().findByOrganizationId(organizationId); 118 } 119 120 /** 121 * Returns a range of all the org labors where organizationId = ?. 122 * 123 * <p> 124 * 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 OrgLaborModelImpl}. 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. 125 * </p> 126 * 127 * @param organizationId the organization ID 128 * @param start the lower bound of the range of org labors 129 * @param end the upper bound of the range of org labors (not inclusive) 130 * @return the range of matching org labors 131 */ 132 public static List<OrgLabor> findByOrganizationId(long organizationId, 133 int start, int end) { 134 return getPersistence().findByOrganizationId(organizationId, start, end); 135 } 136 137 /** 138 * Returns an ordered range of all the org labors where organizationId = ?. 139 * 140 * <p> 141 * 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 OrgLaborModelImpl}. 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. 142 * </p> 143 * 144 * @param organizationId the organization ID 145 * @param start the lower bound of the range of org labors 146 * @param end the upper bound of the range of org labors (not inclusive) 147 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 148 * @return the ordered range of matching org labors 149 */ 150 public static List<OrgLabor> findByOrganizationId(long organizationId, 151 int start, int end, OrderByComparator<OrgLabor> orderByComparator) { 152 return getPersistence() 153 .findByOrganizationId(organizationId, start, end, 154 orderByComparator); 155 } 156 157 /** 158 * Returns an ordered range of all the org labors where organizationId = ?. 159 * 160 * <p> 161 * 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 OrgLaborModelImpl}. 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. 162 * </p> 163 * 164 * @param organizationId the organization ID 165 * @param start the lower bound of the range of org labors 166 * @param end the upper bound of the range of org labors (not inclusive) 167 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 168 * @param retrieveFromCache whether to retrieve from the finder cache 169 * @return the ordered range of matching org labors 170 */ 171 public static List<OrgLabor> findByOrganizationId(long organizationId, 172 int start, int end, OrderByComparator<OrgLabor> orderByComparator, 173 boolean retrieveFromCache) { 174 return getPersistence() 175 .findByOrganizationId(organizationId, start, end, 176 orderByComparator, retrieveFromCache); 177 } 178 179 /** 180 * Returns the first org labor in the ordered set where organizationId = ?. 181 * 182 * @param organizationId the organization ID 183 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 184 * @return the first matching org labor 185 * @throws NoSuchOrgLaborException if a matching org labor could not be found 186 */ 187 public static OrgLabor findByOrganizationId_First(long organizationId, 188 OrderByComparator<OrgLabor> orderByComparator) 189 throws com.liferay.portal.exception.NoSuchOrgLaborException { 190 return getPersistence() 191 .findByOrganizationId_First(organizationId, orderByComparator); 192 } 193 194 /** 195 * Returns the first org labor in the ordered set where organizationId = ?. 196 * 197 * @param organizationId the organization ID 198 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 199 * @return the first matching org labor, or <code>null</code> if a matching org labor could not be found 200 */ 201 public static OrgLabor fetchByOrganizationId_First(long organizationId, 202 OrderByComparator<OrgLabor> orderByComparator) { 203 return getPersistence() 204 .fetchByOrganizationId_First(organizationId, 205 orderByComparator); 206 } 207 208 /** 209 * Returns the last org labor in the ordered set where organizationId = ?. 210 * 211 * @param organizationId the organization ID 212 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 213 * @return the last matching org labor 214 * @throws NoSuchOrgLaborException if a matching org labor could not be found 215 */ 216 public static OrgLabor findByOrganizationId_Last(long organizationId, 217 OrderByComparator<OrgLabor> orderByComparator) 218 throws com.liferay.portal.exception.NoSuchOrgLaborException { 219 return getPersistence() 220 .findByOrganizationId_Last(organizationId, orderByComparator); 221 } 222 223 /** 224 * Returns the last org labor in the ordered set where organizationId = ?. 225 * 226 * @param organizationId the organization ID 227 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 228 * @return the last matching org labor, or <code>null</code> if a matching org labor could not be found 229 */ 230 public static OrgLabor fetchByOrganizationId_Last(long organizationId, 231 OrderByComparator<OrgLabor> orderByComparator) { 232 return getPersistence() 233 .fetchByOrganizationId_Last(organizationId, orderByComparator); 234 } 235 236 /** 237 * Returns the org labors before and after the current org labor in the ordered set where organizationId = ?. 238 * 239 * @param orgLaborId the primary key of the current org labor 240 * @param organizationId the organization ID 241 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 242 * @return the previous, current, and next org labor 243 * @throws NoSuchOrgLaborException if a org labor with the primary key could not be found 244 */ 245 public static OrgLabor[] findByOrganizationId_PrevAndNext(long orgLaborId, 246 long organizationId, OrderByComparator<OrgLabor> orderByComparator) 247 throws com.liferay.portal.exception.NoSuchOrgLaborException { 248 return getPersistence() 249 .findByOrganizationId_PrevAndNext(orgLaborId, 250 organizationId, orderByComparator); 251 } 252 253 /** 254 * Removes all the org labors where organizationId = ? from the database. 255 * 256 * @param organizationId the organization ID 257 */ 258 public static void removeByOrganizationId(long organizationId) { 259 getPersistence().removeByOrganizationId(organizationId); 260 } 261 262 /** 263 * Returns the number of org labors where organizationId = ?. 264 * 265 * @param organizationId the organization ID 266 * @return the number of matching org labors 267 */ 268 public static int countByOrganizationId(long organizationId) { 269 return getPersistence().countByOrganizationId(organizationId); 270 } 271 272 /** 273 * Caches the org labor in the entity cache if it is enabled. 274 * 275 * @param orgLabor the org labor 276 */ 277 public static void cacheResult(OrgLabor orgLabor) { 278 getPersistence().cacheResult(orgLabor); 279 } 280 281 /** 282 * Caches the org labors in the entity cache if it is enabled. 283 * 284 * @param orgLabors the org labors 285 */ 286 public static void cacheResult(List<OrgLabor> orgLabors) { 287 getPersistence().cacheResult(orgLabors); 288 } 289 290 /** 291 * Creates a new org labor with the primary key. Does not add the org labor to the database. 292 * 293 * @param orgLaborId the primary key for the new org labor 294 * @return the new org labor 295 */ 296 public static OrgLabor create(long orgLaborId) { 297 return getPersistence().create(orgLaborId); 298 } 299 300 /** 301 * Removes the org labor with the primary key from the database. Also notifies the appropriate model listeners. 302 * 303 * @param orgLaborId the primary key of the org labor 304 * @return the org labor that was removed 305 * @throws NoSuchOrgLaborException if a org labor with the primary key could not be found 306 */ 307 public static OrgLabor remove(long orgLaborId) 308 throws com.liferay.portal.exception.NoSuchOrgLaborException { 309 return getPersistence().remove(orgLaborId); 310 } 311 312 public static OrgLabor updateImpl(OrgLabor orgLabor) { 313 return getPersistence().updateImpl(orgLabor); 314 } 315 316 /** 317 * Returns the org labor with the primary key or throws a {@link NoSuchOrgLaborException} if it could not be found. 318 * 319 * @param orgLaborId the primary key of the org labor 320 * @return the org labor 321 * @throws NoSuchOrgLaborException if a org labor with the primary key could not be found 322 */ 323 public static OrgLabor findByPrimaryKey(long orgLaborId) 324 throws com.liferay.portal.exception.NoSuchOrgLaborException { 325 return getPersistence().findByPrimaryKey(orgLaborId); 326 } 327 328 /** 329 * Returns the org labor with the primary key or returns <code>null</code> if it could not be found. 330 * 331 * @param orgLaborId the primary key of the org labor 332 * @return the org labor, or <code>null</code> if a org labor with the primary key could not be found 333 */ 334 public static OrgLabor fetchByPrimaryKey(long orgLaborId) { 335 return getPersistence().fetchByPrimaryKey(orgLaborId); 336 } 337 338 public static java.util.Map<java.io.Serializable, OrgLabor> fetchByPrimaryKeys( 339 java.util.Set<java.io.Serializable> primaryKeys) { 340 return getPersistence().fetchByPrimaryKeys(primaryKeys); 341 } 342 343 /** 344 * Returns all the org labors. 345 * 346 * @return the org labors 347 */ 348 public static List<OrgLabor> findAll() { 349 return getPersistence().findAll(); 350 } 351 352 /** 353 * Returns a range of all the org labors. 354 * 355 * <p> 356 * 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 OrgLaborModelImpl}. 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. 357 * </p> 358 * 359 * @param start the lower bound of the range of org labors 360 * @param end the upper bound of the range of org labors (not inclusive) 361 * @return the range of org labors 362 */ 363 public static List<OrgLabor> findAll(int start, int end) { 364 return getPersistence().findAll(start, end); 365 } 366 367 /** 368 * Returns an ordered range of all the org labors. 369 * 370 * <p> 371 * 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 OrgLaborModelImpl}. 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. 372 * </p> 373 * 374 * @param start the lower bound of the range of org labors 375 * @param end the upper bound of the range of org labors (not inclusive) 376 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 377 * @return the ordered range of org labors 378 */ 379 public static List<OrgLabor> findAll(int start, int end, 380 OrderByComparator<OrgLabor> orderByComparator) { 381 return getPersistence().findAll(start, end, orderByComparator); 382 } 383 384 /** 385 * Returns an ordered range of all the org labors. 386 * 387 * <p> 388 * 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 OrgLaborModelImpl}. 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. 389 * </p> 390 * 391 * @param start the lower bound of the range of org labors 392 * @param end the upper bound of the range of org labors (not inclusive) 393 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 394 * @param retrieveFromCache whether to retrieve from the finder cache 395 * @return the ordered range of org labors 396 */ 397 public static List<OrgLabor> findAll(int start, int end, 398 OrderByComparator<OrgLabor> orderByComparator, boolean retrieveFromCache) { 399 return getPersistence() 400 .findAll(start, end, orderByComparator, retrieveFromCache); 401 } 402 403 /** 404 * Removes all the org labors from the database. 405 */ 406 public static void removeAll() { 407 getPersistence().removeAll(); 408 } 409 410 /** 411 * Returns the number of org labors. 412 * 413 * @return the number of org labors 414 */ 415 public static int countAll() { 416 return getPersistence().countAll(); 417 } 418 419 public static OrgLaborPersistence getPersistence() { 420 if (_persistence == null) { 421 _persistence = (OrgLaborPersistence)PortalBeanLocatorUtil.locate(OrgLaborPersistence.class.getName()); 422 423 ReferenceRegistry.registerReference(OrgLaborUtil.class, 424 "_persistence"); 425 } 426 427 return _persistence; 428 } 429 430 private static OrgLaborPersistence _persistence; 431 }