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