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