<?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="findAllCurrentOwners">
        <![CDATA[
            SELECT 
                currentOwner
            FROM 
                AvailablesOwnersView currentOwner
            WHERE 
                currentOwner.officeId = :officeId
            ORDER BY currentOwner.userName
        ]]>
    </query>
    
    <query name="findAllNewOwners">
        <![CDATA[
            SELECT 
                newOwner
            FROM 
                AvailablesOwnersView newOwner
            WHERE 
                newOwner.officeId = :officeId AND
                newOwner.userId != :userId
            ORDER BY newOwner.userName
        ]]>
    </query>
    
</hibernate-mapping>