<?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="updateOrderInList">
        <![CDATA[
            UPDATE 
                LoanByUser 
            SET 
                orderInList = :orderInList
            WHERE
                id = :id
        ]]>
    </query>
    
    <query name="updateLoandByUserByLoanId">
        <![CDATA[
            UPDATE 
                LoanByUser 
            SET 
                loanByUserStatus = :loanByUserStatus
            WHERE
                loan = :loan
        ]]>
    </query>
    
    <query name="updateLoanByUserStatusWhereLoanIn">
        <![CDATA[
            UPDATE 
                LoanByUser 
            SET 
                loanByUserStatus = :loanByUserStatus
            WHERE
                loan IN :loan
        ]]>
    </query>
    
    <query name="updateLoandByUserByUserId">
        <![CDATA[
            UPDATE 
                LoanByUser 
            SET 
                user = :user
            WHERE
                loan = :loan
        ]]>
    </query>
    
    <query name="findLoandByUserByLoanId">
        <![CDATA[
            SELECT
                lu
            FROM
                LoanByUser lu
            WHERE
                loan = :loan
        ]]>
    </query>
    
    <query name="changeLoansBetweenUsersInLoanIds">
        <![CDATA[
            UPDATE 
                LoanByUser
            SET 
                user = :user,
                createdOn = CURDATE()
            WHERE
                loan IN :loans
        ]]>
    </query>
    
</hibernate-mapping>
