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 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.exception.SystemException; 022 import com.liferay.portal.kernel.util.OrderByComparator; 023 import com.liferay.portal.kernel.util.ReferenceRegistry; 024 import com.liferay.portal.model.OrgLabor; 025 import com.liferay.portal.service.ServiceContext; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the org labor service. This utility wraps {@link 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. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see OrgLaborPersistence 038 * @see OrgLaborPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class OrgLaborUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(OrgLabor orgLabor) { 060 getPersistence().clearCache(orgLabor); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) 067 throws SystemException { 068 return getPersistence().countWithDynamicQuery(dynamicQuery); 069 } 070 071 /** 072 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 073 */ 074 public static List<OrgLabor> findWithDynamicQuery(DynamicQuery dynamicQuery) 075 throws SystemException { 076 return getPersistence().findWithDynamicQuery(dynamicQuery); 077 } 078 079 /** 080 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 081 */ 082 public static List<OrgLabor> findWithDynamicQuery( 083 DynamicQuery dynamicQuery, int start, int end) 084 throws SystemException { 085 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 086 } 087 088 /** 089 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 090 */ 091 public static List<OrgLabor> findWithDynamicQuery( 092 DynamicQuery dynamicQuery, int start, int end, 093 OrderByComparator orderByComparator) throws SystemException { 094 return getPersistence() 095 .findWithDynamicQuery(dynamicQuery, start, end, 096 orderByComparator); 097 } 098 099 /** 100 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 101 */ 102 public static OrgLabor update(OrgLabor orgLabor) throws SystemException { 103 return getPersistence().update(orgLabor); 104 } 105 106 /** 107 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 108 */ 109 public static OrgLabor update(OrgLabor orgLabor, 110 ServiceContext serviceContext) throws SystemException { 111 return getPersistence().update(orgLabor, serviceContext); 112 } 113 114 /** 115 * Returns all the org labors where organizationId = ?. 116 * 117 * @param organizationId the organization ID 118 * @return the matching org labors 119 * @throws SystemException if a system exception occurred 120 */ 121 public static java.util.List<com.liferay.portal.model.OrgLabor> findByOrganizationId( 122 long organizationId) 123 throws com.liferay.portal.kernel.exception.SystemException { 124 return getPersistence().findByOrganizationId(organizationId); 125 } 126 127 /** 128 * Returns a range of all the org labors where organizationId = ?. 129 * 130 * <p> 131 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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. 132 * </p> 133 * 134 * @param organizationId the organization ID 135 * @param start the lower bound of the range of org labors 136 * @param end the upper bound of the range of org labors (not inclusive) 137 * @return the range of matching org labors 138 * @throws SystemException if a system exception occurred 139 */ 140 public static java.util.List<com.liferay.portal.model.OrgLabor> findByOrganizationId( 141 long organizationId, int start, int end) 142 throws com.liferay.portal.kernel.exception.SystemException { 143 return getPersistence().findByOrganizationId(organizationId, start, end); 144 } 145 146 /** 147 * Returns an ordered range of all the org labors where organizationId = ?. 148 * 149 * <p> 150 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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. 151 * </p> 152 * 153 * @param organizationId the organization ID 154 * @param start the lower bound of the range of org labors 155 * @param end the upper bound of the range of org labors (not inclusive) 156 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 157 * @return the ordered range of matching org labors 158 * @throws SystemException if a system exception occurred 159 */ 160 public static java.util.List<com.liferay.portal.model.OrgLabor> findByOrganizationId( 161 long organizationId, int start, int end, 162 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 163 throws com.liferay.portal.kernel.exception.SystemException { 164 return getPersistence() 165 .findByOrganizationId(organizationId, start, end, 166 orderByComparator); 167 } 168 169 /** 170 * Returns the first org labor in the ordered set where organizationId = ?. 171 * 172 * @param organizationId the organization ID 173 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 174 * @return the first matching org labor 175 * @throws com.liferay.portal.NoSuchOrgLaborException if a matching org labor could not be found 176 * @throws SystemException if a system exception occurred 177 */ 178 public static com.liferay.portal.model.OrgLabor findByOrganizationId_First( 179 long organizationId, 180 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 181 throws com.liferay.portal.NoSuchOrgLaborException, 182 com.liferay.portal.kernel.exception.SystemException { 183 return getPersistence() 184 .findByOrganizationId_First(organizationId, orderByComparator); 185 } 186 187 /** 188 * Returns the first org labor in the ordered set where organizationId = ?. 189 * 190 * @param organizationId the organization ID 191 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 192 * @return the first matching org labor, or <code>null</code> if a matching org labor could not be found 193 * @throws SystemException if a system exception occurred 194 */ 195 public static com.liferay.portal.model.OrgLabor fetchByOrganizationId_First( 196 long organizationId, 197 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 198 throws com.liferay.portal.kernel.exception.SystemException { 199 return getPersistence() 200 .fetchByOrganizationId_First(organizationId, 201 orderByComparator); 202 } 203 204 /** 205 * Returns the last org labor in the ordered set where organizationId = ?. 206 * 207 * @param organizationId the organization ID 208 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 209 * @return the last matching org labor 210 * @throws com.liferay.portal.NoSuchOrgLaborException if a matching org labor could not be found 211 * @throws SystemException if a system exception occurred 212 */ 213 public static com.liferay.portal.model.OrgLabor findByOrganizationId_Last( 214 long organizationId, 215 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 216 throws com.liferay.portal.NoSuchOrgLaborException, 217 com.liferay.portal.kernel.exception.SystemException { 218 return getPersistence() 219 .findByOrganizationId_Last(organizationId, orderByComparator); 220 } 221 222 /** 223 * Returns the last org labor in the ordered set where organizationId = ?. 224 * 225 * @param organizationId the organization ID 226 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 227 * @return the last matching org labor, or <code>null</code> if a matching org labor could not be found 228 * @throws SystemException if a system exception occurred 229 */ 230 public static com.liferay.portal.model.OrgLabor fetchByOrganizationId_Last( 231 long organizationId, 232 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 233 throws com.liferay.portal.kernel.exception.SystemException { 234 return getPersistence() 235 .fetchByOrganizationId_Last(organizationId, orderByComparator); 236 } 237 238 /** 239 * Returns the org labors before and after the current org labor in the ordered set where organizationId = ?. 240 * 241 * @param orgLaborId the primary key of the current org labor 242 * @param organizationId the organization ID 243 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 244 * @return the previous, current, and next org labor 245 * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found 246 * @throws SystemException if a system exception occurred 247 */ 248 public static com.liferay.portal.model.OrgLabor[] findByOrganizationId_PrevAndNext( 249 long orgLaborId, long organizationId, 250 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 251 throws com.liferay.portal.NoSuchOrgLaborException, 252 com.liferay.portal.kernel.exception.SystemException { 253 return getPersistence() 254 .findByOrganizationId_PrevAndNext(orgLaborId, 255 organizationId, orderByComparator); 256 } 257 258 /** 259 * Removes all the org labors where organizationId = ? from the database. 260 * 261 * @param organizationId the organization ID 262 * @throws SystemException if a system exception occurred 263 */ 264 public static void removeByOrganizationId(long organizationId) 265 throws com.liferay.portal.kernel.exception.SystemException { 266 getPersistence().removeByOrganizationId(organizationId); 267 } 268 269 /** 270 * Returns the number of org labors where organizationId = ?. 271 * 272 * @param organizationId the organization ID 273 * @return the number of matching org labors 274 * @throws SystemException if a system exception occurred 275 */ 276 public static int countByOrganizationId(long organizationId) 277 throws com.liferay.portal.kernel.exception.SystemException { 278 return getPersistence().countByOrganizationId(organizationId); 279 } 280 281 /** 282 * Caches the org labor in the entity cache if it is enabled. 283 * 284 * @param orgLabor the org labor 285 */ 286 public static void cacheResult(com.liferay.portal.model.OrgLabor orgLabor) { 287 getPersistence().cacheResult(orgLabor); 288 } 289 290 /** 291 * Caches the org labors in the entity cache if it is enabled. 292 * 293 * @param orgLabors the org labors 294 */ 295 public static void cacheResult( 296 java.util.List<com.liferay.portal.model.OrgLabor> orgLabors) { 297 getPersistence().cacheResult(orgLabors); 298 } 299 300 /** 301 * Creates a new org labor with the primary key. Does not add the org labor to the database. 302 * 303 * @param orgLaborId the primary key for the new org labor 304 * @return the new org labor 305 */ 306 public static com.liferay.portal.model.OrgLabor create(long orgLaborId) { 307 return getPersistence().create(orgLaborId); 308 } 309 310 /** 311 * Removes the org labor with the primary key from the database. Also notifies the appropriate model listeners. 312 * 313 * @param orgLaborId the primary key of the org labor 314 * @return the org labor that was removed 315 * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found 316 * @throws SystemException if a system exception occurred 317 */ 318 public static com.liferay.portal.model.OrgLabor remove(long orgLaborId) 319 throws com.liferay.portal.NoSuchOrgLaborException, 320 com.liferay.portal.kernel.exception.SystemException { 321 return getPersistence().remove(orgLaborId); 322 } 323 324 public static com.liferay.portal.model.OrgLabor updateImpl( 325 com.liferay.portal.model.OrgLabor orgLabor) 326 throws com.liferay.portal.kernel.exception.SystemException { 327 return getPersistence().updateImpl(orgLabor); 328 } 329 330 /** 331 * Returns the org labor with the primary key or throws a {@link com.liferay.portal.NoSuchOrgLaborException} if it could not be found. 332 * 333 * @param orgLaborId the primary key of the org labor 334 * @return the org labor 335 * @throws com.liferay.portal.NoSuchOrgLaborException if a org labor with the primary key could not be found 336 * @throws SystemException if a system exception occurred 337 */ 338 public static com.liferay.portal.model.OrgLabor findByPrimaryKey( 339 long orgLaborId) 340 throws com.liferay.portal.NoSuchOrgLaborException, 341 com.liferay.portal.kernel.exception.SystemException { 342 return getPersistence().findByPrimaryKey(orgLaborId); 343 } 344 345 /** 346 * Returns the org labor with the primary key or returns <code>null</code> if it could not be found. 347 * 348 * @param orgLaborId the primary key of the org labor 349 * @return the org labor, or <code>null</code> if a org labor with the primary key could not be found 350 * @throws SystemException if a system exception occurred 351 */ 352 public static com.liferay.portal.model.OrgLabor fetchByPrimaryKey( 353 long orgLaborId) 354 throws com.liferay.portal.kernel.exception.SystemException { 355 return getPersistence().fetchByPrimaryKey(orgLaborId); 356 } 357 358 /** 359 * Returns all the org labors. 360 * 361 * @return the org labors 362 * @throws SystemException if a system exception occurred 363 */ 364 public static java.util.List<com.liferay.portal.model.OrgLabor> findAll() 365 throws com.liferay.portal.kernel.exception.SystemException { 366 return getPersistence().findAll(); 367 } 368 369 /** 370 * Returns a range of all the org labors. 371 * 372 * <p> 373 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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. 374 * </p> 375 * 376 * @param start the lower bound of the range of org labors 377 * @param end the upper bound of the range of org labors (not inclusive) 378 * @return the range of org labors 379 * @throws SystemException if a system exception occurred 380 */ 381 public static java.util.List<com.liferay.portal.model.OrgLabor> findAll( 382 int start, int end) 383 throws com.liferay.portal.kernel.exception.SystemException { 384 return getPersistence().findAll(start, end); 385 } 386 387 /** 388 * Returns an ordered range of all the org labors. 389 * 390 * <p> 391 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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. 392 * </p> 393 * 394 * @param start the lower bound of the range of org labors 395 * @param end the upper bound of the range of org labors (not inclusive) 396 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 397 * @return the ordered range of org labors 398 * @throws SystemException if a system exception occurred 399 */ 400 public static java.util.List<com.liferay.portal.model.OrgLabor> findAll( 401 int start, int end, 402 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 403 throws com.liferay.portal.kernel.exception.SystemException { 404 return getPersistence().findAll(start, end, orderByComparator); 405 } 406 407 /** 408 * Removes all the org labors from the database. 409 * 410 * @throws SystemException if a system exception occurred 411 */ 412 public static void removeAll() 413 throws com.liferay.portal.kernel.exception.SystemException { 414 getPersistence().removeAll(); 415 } 416 417 /** 418 * Returns the number of org labors. 419 * 420 * @return the number of org labors 421 * @throws SystemException if a system exception occurred 422 */ 423 public static int countAll() 424 throws com.liferay.portal.kernel.exception.SystemException { 425 return getPersistence().countAll(); 426 } 427 428 public static OrgLaborPersistence getPersistence() { 429 if (_persistence == null) { 430 _persistence = (OrgLaborPersistence)PortalBeanLocatorUtil.locate(OrgLaborPersistence.class.getName()); 431 432 ReferenceRegistry.registerReference(OrgLaborUtil.class, 433 "_persistence"); 434 } 435 436 return _persistence; 437 } 438 439 /** 440 * @deprecated As of 6.2.0 441 */ 442 public void setPersistence(OrgLaborPersistence persistence) { 443 } 444 445 private static OrgLaborPersistence _persistence; 446 }