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

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

import com.liferay.portal.service.persistence.BasePersistence;

/**
 * The persistence interface for the mensagem service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Henrique Simoes
 * @see MensagemPersistenceImpl
 * @see MensagemUtil
 * @generated
 */
public interface MensagemPersistence extends BasePersistence<Mensagem> {
    /*
     * NOTE FOR DEVELOPERS:
     *
     * Never modify or reference this interface directly. Always use {@link MensagemUtil} to access the mensagem persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
     */

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

    /**
    * Returns a range of all the mensagems 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.MensagemModelImpl}. 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 mensagems
    * @param end the upper bound of the range of mensagems (not inclusive)
    * @return the range of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByUuid(
        java.lang.String uuid, int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException;

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

    /**
    * Returns the first mensagem 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 mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByUuid_First(
        java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the first mensagem 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 mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByUuid_First(
        java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the last mensagem 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 mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByUuid_Last(
        java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the last mensagem 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 mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByUuid_Last(
        java.lang.String uuid,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

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

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

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

    /**
    * Returns the mensagem where uuid = &#63; and groupId = &#63; or throws a {@link br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException} if it could not be found.
    *
    * @param uuid the uuid
    * @param groupId the group ID
    * @return the matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByUUID_G(
        java.lang.String uuid, long groupId)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagem where uuid = &#63; and groupId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
    *
    * @param uuid the uuid
    * @param groupId the group ID
    * @return the matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByUUID_G(
        java.lang.String uuid, long groupId)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagem where uuid = &#63; and groupId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
    *
    * @param uuid the uuid
    * @param groupId the group ID
    * @param retrieveFromCache whether to use the finder cache
    * @return the matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByUUID_G(
        java.lang.String uuid, long groupId, boolean retrieveFromCache)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Removes the mensagem where uuid = &#63; and groupId = &#63; from the database.
    *
    * @param uuid the uuid
    * @param groupId the group ID
    * @return the mensagem that was removed
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem removeByUUID_G(
        java.lang.String uuid, long groupId)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the number of mensagems where uuid = &#63; and groupId = &#63;.
    *
    * @param uuid the uuid
    * @param groupId the group ID
    * @return the number of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public int countByUUID_G(java.lang.String uuid, long groupId)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns all the mensagems where uuid = &#63; and companyId = &#63;.
    *
    * @param uuid the uuid
    * @param companyId the company ID
    * @return the matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByUuid_C(
        java.lang.String uuid, long companyId)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns a range of all the mensagems where uuid = &#63; and companyId = &#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.MensagemModelImpl}. 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 mensagems
    * @param end the upper bound of the range of mensagems (not inclusive)
    * @return the range of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByUuid_C(
        java.lang.String uuid, long companyId, int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException;

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

    /**
    * Returns the first mensagem in the ordered set where uuid = &#63; and companyId = &#63;.
    *
    * @param uuid the uuid
    * @param companyId the company ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByUuid_C_First(
        java.lang.String uuid, long companyId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the first mensagem in the ordered set where uuid = &#63; and companyId = &#63;.
    *
    * @param uuid the uuid
    * @param companyId the company ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByUuid_C_First(
        java.lang.String uuid, long companyId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the last mensagem in the ordered set where uuid = &#63; and companyId = &#63;.
    *
    * @param uuid the uuid
    * @param companyId the company ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByUuid_C_Last(
        java.lang.String uuid, long companyId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the last mensagem in the ordered set where uuid = &#63; and companyId = &#63;.
    *
    * @param uuid the uuid
    * @param companyId the company ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByUuid_C_Last(
        java.lang.String uuid, long companyId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagems before and after the current mensagem in the ordered set where uuid = &#63; and companyId = &#63;.
    *
    * @param mensagemId the primary key of the current mensagem
    * @param uuid the uuid
    * @param companyId the company ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the previous, current, and next mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a mensagem with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem[] findByUuid_C_PrevAndNext(
        long mensagemId, java.lang.String uuid, long companyId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Removes all the mensagems where uuid = &#63; and companyId = &#63; from the database.
    *
    * @param uuid the uuid
    * @param companyId the company ID
    * @throws SystemException if a system exception occurred
    */
    public void removeByUuid_C(java.lang.String uuid, long companyId)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the number of mensagems where uuid = &#63; and companyId = &#63;.
    *
    * @param uuid the uuid
    * @param companyId the company ID
    * @return the number of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public int countByUuid_C(java.lang.String uuid, long companyId)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagem where codigoMensagem = &#63; or throws a {@link br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException} if it could not be found.
    *
    * @param codigoMensagem the codigo mensagem
    * @return the matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByCodigo(
        java.lang.String codigoMensagem)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagem where codigoMensagem = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
    *
    * @param codigoMensagem the codigo mensagem
    * @return the matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByCodigo(
        java.lang.String codigoMensagem)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagem where codigoMensagem = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
    *
    * @param codigoMensagem the codigo mensagem
    * @param retrieveFromCache whether to use the finder cache
    * @return the matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByCodigo(
        java.lang.String codigoMensagem, boolean retrieveFromCache)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Removes the mensagem where codigoMensagem = &#63; from the database.
    *
    * @param codigoMensagem the codigo mensagem
    * @return the mensagem that was removed
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem removeByCodigo(
        java.lang.String codigoMensagem)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the number of mensagems where codigoMensagem = &#63;.
    *
    * @param codigoMensagem the codigo mensagem
    * @return the number of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public int countByCodigo(java.lang.String codigoMensagem)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns all the mensagems where groupId = &#63;.
    *
    * @param groupId the group ID
    * @return the matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByGroupId(
        long groupId)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns a range of all the mensagems where groupId = &#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.MensagemModelImpl}. 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 groupId the group ID
    * @param start the lower bound of the range of mensagems
    * @param end the upper bound of the range of mensagems (not inclusive)
    * @return the range of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByGroupId(
        long groupId, int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns an ordered range of all the mensagems where groupId = &#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.MensagemModelImpl}. 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 groupId the group ID
    * @param start the lower bound of the range of mensagems
    * @param end the upper bound of the range of mensagems (not inclusive)
    * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
    * @return the ordered range of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByGroupId(
        long groupId, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the first mensagem in the ordered set where groupId = &#63;.
    *
    * @param groupId the group ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByGroupId_First(
        long groupId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

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

    /**
    * Returns the last mensagem in the ordered set where groupId = &#63;.
    *
    * @param groupId the group ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByGroupId_Last(
        long groupId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

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

    /**
    * Returns the mensagems before and after the current mensagem in the ordered set where groupId = &#63;.
    *
    * @param mensagemId the primary key of the current mensagem
    * @param groupId the group ID
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the previous, current, and next mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a mensagem with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem[] findByGroupId_PrevAndNext(
        long mensagemId, long groupId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Removes all the mensagems where groupId = &#63; from the database.
    *
    * @param groupId the group ID
    * @throws SystemException if a system exception occurred
    */
    public void removeByGroupId(long groupId)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the number of mensagems where groupId = &#63;.
    *
    * @param groupId the group ID
    * @return the number of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public int countByGroupId(long groupId)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns all the mensagems where statusWorkflow = &#63;.
    *
    * @param statusWorkflow the status workflow
    * @return the matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByStatusWorkflow(
        int statusWorkflow)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns a range of all the mensagems where statusWorkflow = &#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.MensagemModelImpl}. 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 statusWorkflow the status workflow
    * @param start the lower bound of the range of mensagems
    * @param end the upper bound of the range of mensagems (not inclusive)
    * @return the range of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByStatusWorkflow(
        int statusWorkflow, int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns an ordered range of all the mensagems where statusWorkflow = &#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.MensagemModelImpl}. 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 statusWorkflow the status workflow
    * @param start the lower bound of the range of mensagems
    * @param end the upper bound of the range of mensagems (not inclusive)
    * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
    * @return the ordered range of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByStatusWorkflow(
        int statusWorkflow, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the first mensagem in the ordered set where statusWorkflow = &#63;.
    *
    * @param statusWorkflow the status workflow
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByStatusWorkflow_First(
        int statusWorkflow,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the first mensagem in the ordered set where statusWorkflow = &#63;.
    *
    * @param statusWorkflow the status workflow
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByStatusWorkflow_First(
        int statusWorkflow,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the last mensagem in the ordered set where statusWorkflow = &#63;.
    *
    * @param statusWorkflow the status workflow
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByStatusWorkflow_Last(
        int statusWorkflow,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the last mensagem in the ordered set where statusWorkflow = &#63;.
    *
    * @param statusWorkflow the status workflow
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByStatusWorkflow_Last(
        int statusWorkflow,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagems before and after the current mensagem in the ordered set where statusWorkflow = &#63;.
    *
    * @param mensagemId the primary key of the current mensagem
    * @param statusWorkflow the status workflow
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the previous, current, and next mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a mensagem with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem[] findByStatusWorkflow_PrevAndNext(
        long mensagemId, int statusWorkflow,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Removes all the mensagems where statusWorkflow = &#63; from the database.
    *
    * @param statusWorkflow the status workflow
    * @throws SystemException if a system exception occurred
    */
    public void removeByStatusWorkflow(int statusWorkflow)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the number of mensagems where statusWorkflow = &#63;.
    *
    * @param statusWorkflow the status workflow
    * @return the number of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public int countByStatusWorkflow(int statusWorkflow)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns all the mensagems where userIdCriador = &#63;.
    *
    * @param userIdCriador the user ID criador
    * @return the matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByUserIdCriador(
        long userIdCriador)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns a range of all the mensagems where userIdCriador = &#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.MensagemModelImpl}. 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 userIdCriador the user ID criador
    * @param start the lower bound of the range of mensagems
    * @param end the upper bound of the range of mensagems (not inclusive)
    * @return the range of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByUserIdCriador(
        long userIdCriador, int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns an ordered range of all the mensagems where userIdCriador = &#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.MensagemModelImpl}. 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 userIdCriador the user ID criador
    * @param start the lower bound of the range of mensagems
    * @param end the upper bound of the range of mensagems (not inclusive)
    * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
    * @return the ordered range of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> findByUserIdCriador(
        long userIdCriador, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the first mensagem in the ordered set where userIdCriador = &#63;.
    *
    * @param userIdCriador the user ID criador
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByUserIdCriador_First(
        long userIdCriador,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the first mensagem in the ordered set where userIdCriador = &#63;.
    *
    * @param userIdCriador the user ID criador
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the first matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByUserIdCriador_First(
        long userIdCriador,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the last mensagem in the ordered set where userIdCriador = &#63;.
    *
    * @param userIdCriador the user ID criador
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByUserIdCriador_Last(
        long userIdCriador,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the last mensagem in the ordered set where userIdCriador = &#63;.
    *
    * @param userIdCriador the user ID criador
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the last matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByUserIdCriador_Last(
        long userIdCriador,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagems before and after the current mensagem in the ordered set where userIdCriador = &#63;.
    *
    * @param mensagemId the primary key of the current mensagem
    * @param userIdCriador the user ID criador
    * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
    * @return the previous, current, and next mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a mensagem with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem[] findByUserIdCriador_PrevAndNext(
        long mensagemId, long userIdCriador,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Removes all the mensagems where userIdCriador = &#63; from the database.
    *
    * @param userIdCriador the user ID criador
    * @throws SystemException if a system exception occurred
    */
    public void removeByUserIdCriador(long userIdCriador)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the number of mensagems where userIdCriador = &#63;.
    *
    * @param userIdCriador the user ID criador
    * @return the number of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public int countByUserIdCriador(long userIdCriador)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagem where rascunho = &#63; and userIdCriador = &#63; or throws a {@link br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException} if it could not be found.
    *
    * @param rascunho the rascunho
    * @param userIdCriador the user ID criador
    * @return the matching mensagem
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem findByRascunhoCriador(
        boolean rascunho, long userIdCriador)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagem where rascunho = &#63; and userIdCriador = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
    *
    * @param rascunho the rascunho
    * @param userIdCriador the user ID criador
    * @return the matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByRascunhoCriador(
        boolean rascunho, long userIdCriador)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the mensagem where rascunho = &#63; and userIdCriador = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
    *
    * @param rascunho the rascunho
    * @param userIdCriador the user ID criador
    * @param retrieveFromCache whether to use the finder cache
    * @return the matching mensagem, or <code>null</code> if a matching mensagem could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem fetchByRascunhoCriador(
        boolean rascunho, long userIdCriador, boolean retrieveFromCache)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Removes the mensagem where rascunho = &#63; and userIdCriador = &#63; from the database.
    *
    * @param rascunho the rascunho
    * @param userIdCriador the user ID criador
    * @return the mensagem that was removed
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem removeByRascunhoCriador(
        boolean rascunho, long userIdCriador)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    /**
    * Returns the number of mensagems where rascunho = &#63; and userIdCriador = &#63;.
    *
    * @param rascunho the rascunho
    * @param userIdCriador the user ID criador
    * @return the number of matching mensagems
    * @throws SystemException if a system exception occurred
    */
    public int countByRascunhoCriador(boolean rascunho, long userIdCriador)
        throws com.liferay.portal.kernel.exception.SystemException;

    /**
    * Caches the mensagem in the entity cache if it is enabled.
    *
    * @param mensagem the mensagem
    */
    public void cacheResult(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem mensagem);

    /**
    * Caches the mensagems in the entity cache if it is enabled.
    *
    * @param mensagems the mensagems
    */
    public void cacheResult(
        java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem> mensagems);

    /**
    * Creates a new mensagem with the primary key. Does not add the mensagem to the database.
    *
    * @param mensagemId the primary key for the new mensagem
    * @return the new mensagem
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem create(
        long mensagemId);

    /**
    * Removes the mensagem with the primary key from the database. Also notifies the appropriate model listeners.
    *
    * @param mensagemId the primary key of the mensagem
    * @return the mensagem that was removed
    * @throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException if a mensagem with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem remove(
        long mensagemId)
        throws br.mp.mprj.portal.portlet.gestaomensagens.service.NoSuchMensagemException,
            com.liferay.portal.kernel.exception.SystemException;

    public br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem updateImpl(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem mensagem)
        throws com.liferay.portal.kernel.exception.SystemException;

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

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

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

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

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

    /**
    * Removes all the mensagems from the database.
    *
    * @throws SystemException if a system exception occurred
    */
    public void removeAll()
        throws com.liferay.portal.kernel.exception.SystemException;

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