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