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