Example usage for com.liferay.portal.kernel.dao.orm QueryUtil list

List of usage examples for com.liferay.portal.kernel.dao.orm QueryUtil list

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.orm QueryUtil list.

Prototype

public static List<?> list(Query query, Dialect dialect, int start, int end, boolean unmodifiable) 

Source Link

Usage

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoInscricaoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento inscricaos where uuid = &#63; and companyId = &#63;.
 *
 * <p>/*  w w w. j a  va 2  s  .com*/
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoInscricaoModelImpl}. 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.
 * </p>
 *
 * @param uuid the uuid
 * @param companyId the company ID
 * @param start the lower bound of the range of evento inscricaos
 * @param end the upper bound of the range of evento inscricaos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento inscricaos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoInscricao> findByUuid_C(String uuid, long companyId, int start, int end,
        OrderByComparator orderByComparator) throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_UUID_C;
        finderArgs = new Object[] { uuid, companyId };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_UUID_C;
        finderArgs = new Object[] { uuid, companyId,

                start, end, orderByComparator };
    }

    List<EventoInscricao> list = (List<EventoInscricao>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoInscricao eventoInscricao : list) {
            if (!Validator.equals(uuid, eventoInscricao.getUuid())
                    || (companyId != eventoInscricao.getCompanyId())) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(4 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(4);
        }

        query.append(_SQL_SELECT_EVENTOINSCRICAO_WHERE);

        boolean bindUuid = false;

        if (uuid == null) {
            query.append(_FINDER_COLUMN_UUID_C_UUID_1);
        } else if (uuid.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_UUID_C_UUID_3);
        } else {
            bindUuid = true;

            query.append(_FINDER_COLUMN_UUID_C_UUID_2);
        }

        query.append(_FINDER_COLUMN_UUID_C_COMPANYID_2);

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoInscricaoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            if (bindUuid) {
                qPos.add(uuid);
            }

            qPos.add(companyId);

            if (!pagination) {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoInscricao>(list);
            } else {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoInscricaoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento inscricaos where companyId = &#63; and groupId = &#63;.
 *
 * <p>/*from w  w w. ja  v a  2  s . c o m*/
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoInscricaoModelImpl}. 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.
 * </p>
 *
 * @param companyId the company ID
 * @param groupId the group ID
 * @param start the lower bound of the range of evento inscricaos
 * @param end the upper bound of the range of evento inscricaos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento inscricaos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoInscricao> findByCG(long companyId, long groupId, int start, int end,
        OrderByComparator orderByComparator) throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CG;
        finderArgs = new Object[] { companyId, groupId };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_CG;
        finderArgs = new Object[] { companyId, groupId,

                start, end, orderByComparator };
    }

    List<EventoInscricao> list = (List<EventoInscricao>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoInscricao eventoInscricao : list) {
            if ((companyId != eventoInscricao.getCompanyId()) || (groupId != eventoInscricao.getGroupId())) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(4 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(4);
        }

        query.append(_SQL_SELECT_EVENTOINSCRICAO_WHERE);

        query.append(_FINDER_COLUMN_CG_COMPANYID_2);

        query.append(_FINDER_COLUMN_CG_GROUPID_2);

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoInscricaoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            qPos.add(companyId);

            qPos.add(groupId);

            if (!pagination) {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoInscricao>(list);
            } else {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoInscricaoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento inscricaos where companyId = &#63; and groupId = &#63; and eventoAgendaId = &#63;.
 *
 * <p>//from  w  ww .j a v  a2 s. c o  m
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoInscricaoModelImpl}. 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.
 * </p>
 *
 * @param companyId the company ID
 * @param groupId the group ID
 * @param eventoAgendaId the evento agenda ID
 * @param start the lower bound of the range of evento inscricaos
 * @param end the upper bound of the range of evento inscricaos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento inscricaos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoInscricao> findByCG_EventoAgenda(long companyId, long groupId, long eventoAgendaId, int start,
        int end, OrderByComparator orderByComparator) throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CG_EVENTOAGENDA;
        finderArgs = new Object[] { companyId, groupId, eventoAgendaId };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_CG_EVENTOAGENDA;
        finderArgs = new Object[] { companyId, groupId, eventoAgendaId,

                start, end, orderByComparator };
    }

    List<EventoInscricao> list = (List<EventoInscricao>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoInscricao eventoInscricao : list) {
            if ((companyId != eventoInscricao.getCompanyId()) || (groupId != eventoInscricao.getGroupId())
                    || (eventoAgendaId != eventoInscricao.getEventoAgendaId())) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(5 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(5);
        }

        query.append(_SQL_SELECT_EVENTOINSCRICAO_WHERE);

        query.append(_FINDER_COLUMN_CG_EVENTOAGENDA_COMPANYID_2);

        query.append(_FINDER_COLUMN_CG_EVENTOAGENDA_GROUPID_2);

        query.append(_FINDER_COLUMN_CG_EVENTOAGENDA_EVENTOAGENDAID_2);

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoInscricaoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            qPos.add(companyId);

            qPos.add(groupId);

            qPos.add(eventoAgendaId);

            if (!pagination) {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoInscricao>(list);
            } else {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoInscricaoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento inscricaos where companyId = &#63; and groupId = &#63; and eventoId = &#63;.
 *
 * <p>//from  ww  w  .  j  a v a  2  s. c  om
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoInscricaoModelImpl}. 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.
 * </p>
 *
 * @param companyId the company ID
 * @param groupId the group ID
 * @param eventoId the evento ID
 * @param start the lower bound of the range of evento inscricaos
 * @param end the upper bound of the range of evento inscricaos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento inscricaos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoInscricao> findByCG_Evento(long companyId, long groupId, long eventoId, int start, int end,
        OrderByComparator orderByComparator) throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CG_EVENTO;
        finderArgs = new Object[] { companyId, groupId, eventoId };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_CG_EVENTO;
        finderArgs = new Object[] { companyId, groupId, eventoId,

                start, end, orderByComparator };
    }

    List<EventoInscricao> list = (List<EventoInscricao>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoInscricao eventoInscricao : list) {
            if ((companyId != eventoInscricao.getCompanyId()) || (groupId != eventoInscricao.getGroupId())
                    || (eventoId != eventoInscricao.getEventoId())) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(5 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(5);
        }

        query.append(_SQL_SELECT_EVENTOINSCRICAO_WHERE);

        query.append(_FINDER_COLUMN_CG_EVENTO_COMPANYID_2);

        query.append(_FINDER_COLUMN_CG_EVENTO_GROUPID_2);

        query.append(_FINDER_COLUMN_CG_EVENTO_EVENTOID_2);

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoInscricaoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            qPos.add(companyId);

            qPos.add(groupId);

            qPos.add(eventoId);

            if (!pagination) {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoInscricao>(list);
            } else {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoInscricaoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento inscricaos where companyId = &#63; and groupId = &#63; and userNome LIKE &#63;.
 *
 * <p>/*from   www .java2s  . co m*/
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoInscricaoModelImpl}. 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.
 * </p>
 *
 * @param companyId the company ID
 * @param groupId the group ID
 * @param userNome the user nome
 * @param start the lower bound of the range of evento inscricaos
 * @param end the upper bound of the range of evento inscricaos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento inscricaos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoInscricao> findByCG_Usuario(long companyId, long groupId, String userNome, int start, int end,
        OrderByComparator orderByComparator) throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_CG_USUARIO;
    finderArgs = new Object[] { companyId, groupId, userNome,

            start, end, orderByComparator };

    List<EventoInscricao> list = (List<EventoInscricao>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoInscricao eventoInscricao : list) {
            if ((companyId != eventoInscricao.getCompanyId()) || (groupId != eventoInscricao.getGroupId())
                    || !StringUtil.wildcardMatches(eventoInscricao.getUserNome(), userNome, CharPool.UNDERLINE,
                            CharPool.PERCENT, CharPool.BACK_SLASH, true)) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(5 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(5);
        }

        query.append(_SQL_SELECT_EVENTOINSCRICAO_WHERE);

        query.append(_FINDER_COLUMN_CG_USUARIO_COMPANYID_2);

        query.append(_FINDER_COLUMN_CG_USUARIO_GROUPID_2);

        boolean bindUserNome = false;

        if (userNome == null) {
            query.append(_FINDER_COLUMN_CG_USUARIO_USERNOME_1);
        } else if (userNome.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_CG_USUARIO_USERNOME_3);
        } else {
            bindUserNome = true;

            query.append(_FINDER_COLUMN_CG_USUARIO_USERNOME_2);
        }

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoInscricaoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            qPos.add(companyId);

            qPos.add(groupId);

            if (bindUserNome) {
                qPos.add(userNome);
            }

            if (!pagination) {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoInscricao>(list);
            } else {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoInscricaoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento inscricaos.
 *
 * <p>/*from   www  .  jav  a2 s .  c  o  m*/
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoInscricaoModelImpl}. 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.
 * </p>
 *
 * @param start the lower bound of the range of evento inscricaos
 * @param end the upper bound of the range of evento inscricaos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of evento inscricaos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoInscricao> findAll(int start, int end, OrderByComparator orderByComparator)
        throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
        finderArgs = FINDER_ARGS_EMPTY;
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
        finderArgs = new Object[] { start, end, orderByComparator };
    }

    List<EventoInscricao> list = (List<EventoInscricao>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if (list == null) {
        StringBundler query = null;
        String sql = null;

        if (orderByComparator != null) {
            query = new StringBundler(2 + (orderByComparator.getOrderByFields().length * 3));

            query.append(_SQL_SELECT_EVENTOINSCRICAO);

            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);

            sql = query.toString();
        } else {
            sql = _SQL_SELECT_EVENTOINSCRICAO;

            if (pagination) {
                sql = sql.concat(EventoInscricaoModelImpl.ORDER_BY_JPQL);
            }
        }

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            if (!pagination) {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoInscricao>(list);
            } else {
                list = (List<EventoInscricao>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoNaoInscritoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento nao inscritos where uuid = &#63;.
 *
 * <p>//  w  w  w  . j  ava  2  s  .  c  o m
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoNaoInscritoModelImpl}. 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.
 * </p>
 *
 * @param uuid the uuid
 * @param start the lower bound of the range of evento nao inscritos
 * @param end the upper bound of the range of evento nao inscritos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento nao inscritos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoNaoInscrito> findByUuid(String uuid, int start, int end, OrderByComparator orderByComparator)
        throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_UUID;
        finderArgs = new Object[] { uuid };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_UUID;
        finderArgs = new Object[] { uuid, start, end, orderByComparator };
    }

    List<EventoNaoInscrito> list = (List<EventoNaoInscrito>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoNaoInscrito eventoNaoInscrito : list) {
            if (!Validator.equals(uuid, eventoNaoInscrito.getUuid())) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(3 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(3);
        }

        query.append(_SQL_SELECT_EVENTONAOINSCRITO_WHERE);

        boolean bindUuid = false;

        if (uuid == null) {
            query.append(_FINDER_COLUMN_UUID_UUID_1);
        } else if (uuid.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_UUID_UUID_3);
        } else {
            bindUuid = true;

            query.append(_FINDER_COLUMN_UUID_UUID_2);
        }

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoNaoInscritoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            if (bindUuid) {
                qPos.add(uuid);
            }

            if (!pagination) {
                list = (List<EventoNaoInscrito>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoNaoInscrito>(list);
            } else {
                list = (List<EventoNaoInscrito>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoNaoInscritoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento nao inscritos where uuid = &#63; and companyId = &#63;.
 *
 * <p>/*ww w  . ja v  a2  s. c  o m*/
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoNaoInscritoModelImpl}. 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.
 * </p>
 *
 * @param uuid the uuid
 * @param companyId the company ID
 * @param start the lower bound of the range of evento nao inscritos
 * @param end the upper bound of the range of evento nao inscritos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento nao inscritos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoNaoInscrito> findByUuid_C(String uuid, long companyId, int start, int end,
        OrderByComparator orderByComparator) throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_UUID_C;
        finderArgs = new Object[] { uuid, companyId };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_UUID_C;
        finderArgs = new Object[] { uuid, companyId,

                start, end, orderByComparator };
    }

    List<EventoNaoInscrito> list = (List<EventoNaoInscrito>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoNaoInscrito eventoNaoInscrito : list) {
            if (!Validator.equals(uuid, eventoNaoInscrito.getUuid())
                    || (companyId != eventoNaoInscrito.getCompanyId())) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(4 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(4);
        }

        query.append(_SQL_SELECT_EVENTONAOINSCRITO_WHERE);

        boolean bindUuid = false;

        if (uuid == null) {
            query.append(_FINDER_COLUMN_UUID_C_UUID_1);
        } else if (uuid.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_UUID_C_UUID_3);
        } else {
            bindUuid = true;

            query.append(_FINDER_COLUMN_UUID_C_UUID_2);
        }

        query.append(_FINDER_COLUMN_UUID_C_COMPANYID_2);

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoNaoInscritoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            if (bindUuid) {
                qPos.add(uuid);
            }

            qPos.add(companyId);

            if (!pagination) {
                list = (List<EventoNaoInscrito>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoNaoInscrito>(list);
            } else {
                list = (List<EventoNaoInscrito>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoNaoInscritoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento nao inscritos where companyId = &#63; and groupId = &#63;.
 *
 * <p>/*from  ww  w  . j a va  2  s.c  om*/
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoNaoInscritoModelImpl}. 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.
 * </p>
 *
 * @param companyId the company ID
 * @param groupId the group ID
 * @param start the lower bound of the range of evento nao inscritos
 * @param end the upper bound of the range of evento nao inscritos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento nao inscritos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoNaoInscrito> findByCG(long companyId, long groupId, int start, int end,
        OrderByComparator orderByComparator) throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CG;
        finderArgs = new Object[] { companyId, groupId };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_CG;
        finderArgs = new Object[] { companyId, groupId,

                start, end, orderByComparator };
    }

    List<EventoNaoInscrito> list = (List<EventoNaoInscrito>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoNaoInscrito eventoNaoInscrito : list) {
            if ((companyId != eventoNaoInscrito.getCompanyId())
                    || (groupId != eventoNaoInscrito.getGroupId())) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(4 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(4);
        }

        query.append(_SQL_SELECT_EVENTONAOINSCRITO_WHERE);

        query.append(_FINDER_COLUMN_CG_COMPANYID_2);

        query.append(_FINDER_COLUMN_CG_GROUPID_2);

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoNaoInscritoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            qPos.add(companyId);

            qPos.add(groupId);

            if (!pagination) {
                list = (List<EventoNaoInscrito>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoNaoInscrito>(list);
            } else {
                list = (List<EventoNaoInscrito>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}

From source file:br.com.prodevelopment.lapidarios.evento.service.persistence.EventoNaoInscritoPersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the evento nao inscritos where companyId = &#63; and groupId = &#63; and eventoAgendaId = &#63;.
 *
 * <p>//from   w w w . jav  a  2 s .  c  om
 * 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 br.com.prodevelopment.lapidarios.evento.model.impl.EventoNaoInscritoModelImpl}. 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.
 * </p>
 *
 * @param companyId the company ID
 * @param groupId the group ID
 * @param eventoAgendaId the evento agenda ID
 * @param start the lower bound of the range of evento nao inscritos
 * @param end the upper bound of the range of evento nao inscritos (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @return the ordered range of matching evento nao inscritos
 * @throws SystemException if a system exception occurred
 */
@Override
public List<EventoNaoInscrito> findByCG_EventoAgenda(long companyId, long groupId, long eventoAgendaId,
        int start, int end, OrderByComparator orderByComparator) throws SystemException {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CG_EVENTOAGENDA;
        finderArgs = new Object[] { companyId, groupId, eventoAgendaId };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_CG_EVENTOAGENDA;
        finderArgs = new Object[] { companyId, groupId, eventoAgendaId,

                start, end, orderByComparator };
    }

    List<EventoNaoInscrito> list = (List<EventoNaoInscrito>) FinderCacheUtil.getResult(finderPath, finderArgs,
            this);

    if ((list != null) && !list.isEmpty()) {
        for (EventoNaoInscrito eventoNaoInscrito : list) {
            if ((companyId != eventoNaoInscrito.getCompanyId()) || (groupId != eventoNaoInscrito.getGroupId())
                    || (eventoAgendaId != eventoNaoInscrito.getEventoAgendaId())) {
                list = null;

                break;
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(5 + (orderByComparator.getOrderByFields().length * 3));
        } else {
            query = new StringBundler(5);
        }

        query.append(_SQL_SELECT_EVENTONAOINSCRITO_WHERE);

        query.append(_FINDER_COLUMN_CG_EVENTOAGENDA_COMPANYID_2);

        query.append(_FINDER_COLUMN_CG_EVENTOAGENDA_GROUPID_2);

        query.append(_FINDER_COLUMN_CG_EVENTOAGENDA_EVENTOAGENDAID_2);

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(EventoNaoInscritoModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            qPos.add(companyId);

            qPos.add(groupId);

            qPos.add(eventoAgendaId);

            if (!pagination) {
                list = (List<EventoNaoInscrito>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = new UnmodifiableList<EventoNaoInscrito>(list);
            } else {
                list = (List<EventoNaoInscrito>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            FinderCacheUtil.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}