modules/liferay-travel/liferay-travel-service/src/main/java/com/liferay/travel/service/persistence/impl/StagePersistenceImpl.java
/**
	 * Returns an ordered range of all the stages.
	 *
	 * <p>
	 * 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 <code>QueryUtil#ALL_POS</code> 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, then the query will include the default ORDER BY logic from <code>StageModelImpl</code>.
	 * </p>
	 *
	 * @param start the lower bound of the range of stages
	 * @param end the upper bound of the range of stages (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	 * @param useFinderCache whether to use the finder cache
	 * @return the ordered range of stages
	 */
Returns an ordered range of all the stages.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from StageModelImpl.


Returns an ordered range of all the stages . Useful when paginating results . Returns a maximum of end - start instances . start and end are not primary keys they are indexes in the result set . Thus 0 refers to the first result in the set . Setting both start and end to QueryUtil#ALL_POS will return the full result set . If orderByComparator is specified then the query will include the given ORDER BY logic . If orderByComparator is absent then the query will include the default ORDER BY logic from StageModelImpl .
@Override
	public List<Stage> findAll(
		int start, int end, OrderByComparator<Stage> orderByComparator,
		boolean useFinderCache) {
		FinderPath finderPath = null;
		Object[] finderArgs = null;
		if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
			(orderByComparator == null)) {
			if (useFinderCache) {
				finderPath = _finderPathWithoutPaginationFindAll;
				finderArgs = FINDER_ARGS_EMPTY;
			}
		}
		else if (useFinderCache) {
			finderPath = _finderPathWithPaginationFindAll;
			finderArgs = new Object[] {start, end, orderByComparator};
		}
		List<Stage> list = null;
		if (useFinderCache) {
			list = (List<Stage>)finderCache.getResult(
				finderPath, finderArgs, this);
		}
		if (list == null) {
			StringBundler sb = null;
			String sql = null;
			if (orderByComparator != null) {
				sb = new StringBundler(
					2 + (orderByComparator.getOrderByFields().length * 2));
				sb.append(_SQL_SELECT_STAGE);
				appendOrderByComparator(
					sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
				sql = sb.toString();
			}
			else {
				sql = _SQL_SELECT_STAGE;
				sql = sql.concat(StageModelImpl.ORDER_BY_JPQL);
			}
			Session session = null;
			try {
				session = openSession();
				Query query = session.createQuery(sql);
				list = (List<Stage>)QueryUtil.list(
					query, getDialect(), start, end);
				cacheResult(list);
				if (useFinderCache) {
					finderCache.putResult(finderPath, finderArgs, list);
				}
			}
			catch (Exception exception) {
				throw processException(exception);
			}
			finally {
				closeSession(session);
			}
		}
		return list;
	}
@ Override public List < Stage > findAll ( int start , int end , OrderByComparator < Stage > orderByComparator , boolean useFinderCache ) { FinderPath finderPath = null ; Object [ ] finderArgs = null ; if ( ( start == QueryUtil . ALL_POS ) && ( end == QueryUtil . ALL_POS ) && ( orderByComparator == null ) ) { if ( useFinderCache ) { finderPath = _finderPathWithoutPaginationFindAll ; finderArgs = FINDER_ARGS_EMPTY ; } } else if ( useFinderCache ) { finderPath = _finderPathWithPaginationFindAll ; finderArgs = new Object [ ] { start , end , orderByComparator } ; } List < Stage > list = null ; if ( useFinderCache ) { list = ( List < Stage > ) finderCache . getResult ( finderPath , finderArgs , this ) ; } if ( list == null ) { StringBundler sb = null ; String sql = null ; if ( orderByComparator != null ) { sb = new StringBundler ( 2 + ( orderByComparator . getOrderByFields ( ) . length * 2 ) ) ; sb . append ( _SQL_SELECT_STAGE ) ; appendOrderByComparator ( sb , _ORDER_BY_ENTITY_ALIAS , orderByComparator ) ; sql = sb . toString ( ) ; } else { sql = _SQL_SELECT_STAGE ; sql = sql . concat ( StageModelImpl . ORDER_BY_JPQL ) ; } Session session = null ; try { session = openSession ( ) ; Query query = session . createQuery ( sql ) ; list = ( List < Stage > ) QueryUtil . list ( query , getDialect ( ) , start , end ) ; cacheResult ( list ) ; if ( useFinderCache ) { finderCache . putResult ( finderPath , finderArgs , list ) ; } } catch ( Exception exception ) { throw processException ( exception ) ; } finally { closeSession ( session ) ; } } return list ; }
Returns an ordered range of all the stages.
Returns an ordered range of all the stages .