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