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