package br.mp.mprj.portal.portlet.gestaomensagens.service.service.persistence;

import br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.ServiceContext;

import java.util.List;

/**
 * The persistence utility for the email destinatario service. This utility wraps {@link EmailDestinatarioPersistenceImpl} 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.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Henrique Simoes
 * @see EmailDestinatarioPersistence
 * @see EmailDestinatarioPersistenceImpl
 * @generated
 */
public class EmailDestinatarioUtil {
    private static EmailDestinatarioPersistence _persistence;

    /*
     * NOTE FOR DEVELOPERS:
     *
     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
     */

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
     */
    public static void clearCache() {
        getPersistence().clearCache();
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
     */
    public static void clearCache(EmailDestinatario emailDestinatario) {
        getPersistence().clearCache(emailDestinatario);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
     */
    public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
        throws SystemException {
        return getPersistence().countWithDynamicQuery(dynamicQuery);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
     */
    public static List<EmailDestinatario> findWithDynamicQuery(
        DynamicQuery dynamicQuery) throws SystemException {
        return getPersistence().findWithDynamicQuery(dynamicQuery);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
     */
    public static List<EmailDestinatario> findWithDynamicQuery(
        DynamicQuery dynamicQuery, int start, int end)
        throws SystemException {
        return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
     */
    public static List<EmailDestinatario> findWithDynamicQuery(
        DynamicQuery dynamicQuery, int start, int end,
        OrderByComparator orderByComparator) throws SystemException {
        return getPersistence()
                   .findWithDynamicQuery(dynamicQuery, start, end,
            orderByComparator);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
     */
    public static EmailDestinatario update(EmailDestinatario emailDestinatario)
        throws SystemException {
        return getPersistence().update(emailDestinatario);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
     */
    public static EmailDestinatario update(
        EmailDestinatario emailDestinatario, ServiceContext serviceContext)
        throws SystemException {
        return getPersistence().update(emailDestinatario, serviceContext);
    }

    /**
    * Returns all the email destinatarios where uuid = &#63;.
    *
    * @param uuid the uuid
    * @return the matching email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findByUuid(
        java.lang.String uuid)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByUuid(uuid);
    }

    /**
    * Returns a range of all the email destinatarios where uuid = &#63;.
    *
    * <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 {@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.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.EmailDestinatarioModelImpl}. 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 email destinatarios
    * @param end the upper bound of the range of email destinatarios (not inclusive)
    * @return the range of matching email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findByUuid(
        java.lang.String uuid, int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByUuid(uuid, start, end);
    }

    /**
    * Returns an ordered range of all the email destinatarios where uuid = &#63;.
    *
    * <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 {@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.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.EmailDestinatarioModelImpl}. 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 email destinatarios
    * @param end the upper bound of the range of email destinatarios (not inclusive)
    * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
    * @return the ordered range of matching email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findByUuid(
        java.lang.String uuid, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByUuid(uuid, start, end, orderByComparator);
    }

    /**
    * Returns the first email destinatario in the ordered set where uuid = &#63;.
    *
    * @param uuid the uuid
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching email destinatario
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException if a matching email destinatario could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario findByUuid_First(
        java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException,
            com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByUuid_First(uuid, orderByComparator);
    }

    /**
    * Returns the first email destinatario in the ordered set where uuid = &#63;.
    *
    * @param uuid the uuid
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching email destinatario, or <code>null</code> if a matching email destinatario could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario fetchByUuid_First(
        java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().fetchByUuid_First(uuid, orderByComparator);
    }

    /**
    * Returns the last email destinatario in the ordered set where uuid = &#63;.
    *
    * @param uuid the uuid
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching email destinatario
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException if a matching email destinatario could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario findByUuid_Last(
        java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException,
            com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByUuid_Last(uuid, orderByComparator);
    }

    /**
    * Returns the last email destinatario in the ordered set where uuid = &#63;.
    *
    * @param uuid the uuid
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching email destinatario, or <code>null</code> if a matching email destinatario could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario fetchByUuid_Last(
        java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().fetchByUuid_Last(uuid, orderByComparator);
    }

    /**
    * Returns the email destinatarios before and after the current email destinatario in the ordered set where uuid = &#63;.
    *
    * @param emailDestinatarioId the primary key of the current email destinatario
    * @param uuid the uuid
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the previous, current, and next email destinatario
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException if a email destinatario with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario[] findByUuid_PrevAndNext(
        long emailDestinatarioId, java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException,
            com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .findByUuid_PrevAndNext(emailDestinatarioId, uuid,
            orderByComparator);
    }

    /**
    * Removes all the email destinatarios where uuid = &#63; from the database.
    *
    * @param uuid the uuid
    * @throws SystemException if a system exception occurred
    */
    public static void removeByUuid(java.lang.String uuid)
        throws com.liferay.portal.kernel.exception.SystemException {
        getPersistence().removeByUuid(uuid);
    }

    /**
    * Returns the number of email destinatarios where uuid = &#63;.
    *
    * @param uuid the uuid
    * @return the number of matching email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static int countByUuid(java.lang.String uuid)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().countByUuid(uuid);
    }

    /**
    * Returns all the email destinatarios where grupoDestinatarioId = &#63;.
    *
    * @param grupoDestinatarioId the grupo destinatario ID
    * @return the matching email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findByGrupoDestinatarioId(
        long grupoDestinatarioId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByGrupoDestinatarioId(grupoDestinatarioId);
    }

    /**
    * Returns a range of all the email destinatarios where grupoDestinatarioId = &#63;.
    *
    * <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 {@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.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.EmailDestinatarioModelImpl}. 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 grupoDestinatarioId the grupo destinatario ID
    * @param start the lower bound of the range of email destinatarios
    * @param end the upper bound of the range of email destinatarios (not inclusive)
    * @return the range of matching email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findByGrupoDestinatarioId(
        long grupoDestinatarioId, int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .findByGrupoDestinatarioId(grupoDestinatarioId, start, end);
    }

    /**
    * Returns an ordered range of all the email destinatarios where grupoDestinatarioId = &#63;.
    *
    * <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 {@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.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.EmailDestinatarioModelImpl}. 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 grupoDestinatarioId the grupo destinatario ID
    * @param start the lower bound of the range of email destinatarios
    * @param end the upper bound of the range of email destinatarios (not inclusive)
    * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
    * @return the ordered range of matching email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findByGrupoDestinatarioId(
        long grupoDestinatarioId, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .findByGrupoDestinatarioId(grupoDestinatarioId, start, end,
            orderByComparator);
    }

    /**
    * Returns the first email destinatario in the ordered set where grupoDestinatarioId = &#63;.
    *
    * @param grupoDestinatarioId the grupo destinatario ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching email destinatario
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException if a matching email destinatario could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario findByGrupoDestinatarioId_First(
        long grupoDestinatarioId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException,
            com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .findByGrupoDestinatarioId_First(grupoDestinatarioId,
            orderByComparator);
    }

    /**
    * Returns the first email destinatario in the ordered set where grupoDestinatarioId = &#63;.
    *
    * @param grupoDestinatarioId the grupo destinatario ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching email destinatario, or <code>null</code> if a matching email destinatario could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario fetchByGrupoDestinatarioId_First(
        long grupoDestinatarioId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .fetchByGrupoDestinatarioId_First(grupoDestinatarioId,
            orderByComparator);
    }

    /**
    * Returns the last email destinatario in the ordered set where grupoDestinatarioId = &#63;.
    *
    * @param grupoDestinatarioId the grupo destinatario ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching email destinatario
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException if a matching email destinatario could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario findByGrupoDestinatarioId_Last(
        long grupoDestinatarioId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException,
            com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .findByGrupoDestinatarioId_Last(grupoDestinatarioId,
            orderByComparator);
    }

    /**
    * Returns the last email destinatario in the ordered set where grupoDestinatarioId = &#63;.
    *
    * @param grupoDestinatarioId the grupo destinatario ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching email destinatario, or <code>null</code> if a matching email destinatario could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario fetchByGrupoDestinatarioId_Last(
        long grupoDestinatarioId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .fetchByGrupoDestinatarioId_Last(grupoDestinatarioId,
            orderByComparator);
    }

    /**
    * Returns the email destinatarios before and after the current email destinatario in the ordered set where grupoDestinatarioId = &#63;.
    *
    * @param emailDestinatarioId the primary key of the current email destinatario
    * @param grupoDestinatarioId the grupo destinatario ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the previous, current, and next email destinatario
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException if a email destinatario with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario[] findByGrupoDestinatarioId_PrevAndNext(
        long emailDestinatarioId, long grupoDestinatarioId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException,
            com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .findByGrupoDestinatarioId_PrevAndNext(emailDestinatarioId,
            grupoDestinatarioId, orderByComparator);
    }

    /**
    * Removes all the email destinatarios where grupoDestinatarioId = &#63; from the database.
    *
    * @param grupoDestinatarioId the grupo destinatario ID
    * @throws SystemException if a system exception occurred
    */
    public static void removeByGrupoDestinatarioId(long grupoDestinatarioId)
        throws com.liferay.portal.kernel.exception.SystemException {
        getPersistence().removeByGrupoDestinatarioId(grupoDestinatarioId);
    }

    /**
    * Returns the number of email destinatarios where grupoDestinatarioId = &#63;.
    *
    * @param grupoDestinatarioId the grupo destinatario ID
    * @return the number of matching email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static int countByGrupoDestinatarioId(long grupoDestinatarioId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().countByGrupoDestinatarioId(grupoDestinatarioId);
    }

    /**
    * Caches the email destinatario in the entity cache if it is enabled.
    *
    * @param emailDestinatario the email destinatario
    */
    public static void cacheResult(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario emailDestinatario) {
        getPersistence().cacheResult(emailDestinatario);
    }

    /**
    * Caches the email destinatarios in the entity cache if it is enabled.
    *
    * @param emailDestinatarios the email destinatarios
    */
    public static void cacheResult(
        java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> emailDestinatarios) {
        getPersistence().cacheResult(emailDestinatarios);
    }

    /**
    * Creates a new email destinatario with the primary key. Does not add the email destinatario to the database.
    *
    * @param emailDestinatarioId the primary key for the new email destinatario
    * @return the new email destinatario
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario create(
        long emailDestinatarioId) {
        return getPersistence().create(emailDestinatarioId);
    }

    /**
    * Removes the email destinatario with the primary key from the database. Also notifies the appropriate model listeners.
    *
    * @param emailDestinatarioId the primary key of the email destinatario
    * @return the email destinatario that was removed
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException if a email destinatario with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario remove(
        long emailDestinatarioId)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException,
            com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().remove(emailDestinatarioId);
    }

    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario updateImpl(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario emailDestinatario)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().updateImpl(emailDestinatario);
    }

    /**
    * Returns the email destinatario with the primary key or throws a {@link br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException} if it could not be found.
    *
    * @param emailDestinatarioId the primary key of the email destinatario
    * @return the email destinatario
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException if a email destinatario with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario findByPrimaryKey(
        long emailDestinatarioId)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchEmailDestinatarioException,
            com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByPrimaryKey(emailDestinatarioId);
    }

    /**
    * Returns the email destinatario with the primary key or returns <code>null</code> if it could not be found.
    *
    * @param emailDestinatarioId the primary key of the email destinatario
    * @return the email destinatario, or <code>null</code> if a email destinatario with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario fetchByPrimaryKey(
        long emailDestinatarioId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().fetchByPrimaryKey(emailDestinatarioId);
    }

    /**
    * Returns all the email destinatarios.
    *
    * @return the email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findAll()
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findAll();
    }

    /**
    * Returns a range of all the email destinatarios.
    *
    * <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 {@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.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.EmailDestinatarioModelImpl}. 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 email destinatarios
    * @param end the upper bound of the range of email destinatarios (not inclusive)
    * @return the range of email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findAll(
        int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findAll(start, end);
    }

    /**
    * Returns an ordered range of all the email destinatarios.
    *
    * <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 {@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.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.EmailDestinatarioModelImpl}. 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 email destinatarios
    * @param end the upper bound of the range of email destinatarios (not inclusive)
    * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
    * @return the ordered range of email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.EmailDestinatario> findAll(
        int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findAll(start, end, orderByComparator);
    }

    /**
    * Removes all the email destinatarios from the database.
    *
    * @throws SystemException if a system exception occurred
    */
    public static void removeAll()
        throws com.liferay.portal.kernel.exception.SystemException {
        getPersistence().removeAll();
    }

    /**
    * Returns the number of email destinatarios.
    *
    * @return the number of email destinatarios
    * @throws SystemException if a system exception occurred
    */
    public static int countAll()
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().countAll();
    }

    public static EmailDestinatarioPersistence getPersistence() {
        if (_persistence == null) {
            _persistence = (EmailDestinatarioPersistence) PortletBeanLocatorUtil.locate(br.mp.mprj.portal.portlet.gestaomensagens.service.service.ClpSerializer.getServletContextName(),
                    EmailDestinatarioPersistence.class.getName());

            ReferenceRegistry.registerReference(EmailDestinatarioUtil.class,
                "_persistence");
        }

        return _persistence;
    }

    /**
     * @deprecated As of 6.2.0
     */
    public void setPersistence(EmailDestinatarioPersistence persistence) {
    }
}
