<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"https://hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <query name="countNotificationByUserId">
        <![CDATA[
            SELECT COUNT(id)
            FROM ServiceOrderNotificationDeliveryTo
            WHERE 
                user = :user
        ]]>
    </query>
    
    <query name="findDeliveryNotificationByUserAndNotificationId">
        <![CDATA[
            FROM ServiceOrderNotificationDeliveryTo
            WHERE 
                user = :user AND
                serviceOrderNotification = :serviceOrderNotification 
        ]]>
    </query>
    
    <query name="findDeliveryNotificationByUser">
        <![CDATA[
            SELECT delivery
            FROM ServiceOrderNotificationDeliveryTo delivery
            WHERE 
                delivery.user = :user
        ]]>
    </query>
    
</hibernate-mapping>