<?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="findNotificationDetailsByUserIdAndDeliveryStatus">
        <![CDATA[
            SELECT notification
            FROM ServiceOrderNotification notification
            INNER JOIN ServiceOrderNotificationDeliveryTo delivery
                ON notification.id = delivery.serviceOrderNotification
            WHERE 
                delivery.user = :user AND
                delivery.statusType = :statusType
            ORDER BY notification.createdOn DESC
        ]]>
    </query>
    
</hibernate-mapping>