<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
[
]
>

<hibernate-mapping default-lazy="false" default-cascade="none">

	<!-- Collection transform jobs that are ready to send an acknowledgement (AA/AR) -->
	<class name="gov.va.med.cds.scheduler.persistence.CensusAcknowledgementResponse" >
		<id name="censusMasterId" type="java.lang.Long"/>
		<property name="messageControlId" type="java.lang.String"/>
		<property name="sendingApplication" type="java.lang.String"/>
		<property name="stationNumber" type="java.lang.String"/>
		<property name="sendingFacility" type="java.lang.String"/>
		<property name="receivingApplication" type="java.lang.String"/>
		<property name="receivingFacility" type="java.lang.String"/>
		<property name="transformStatus" type="java.lang.String"/>
		<property name="errorMessage" type="java.lang.String"/>
	</class>
	
	<class name="gov.va.med.cds.scheduler.persistence.CensusAppAckUpdateResponse" >
		<id name="censusMasterId" type="java.lang.Long"/>
		<property name="message" type="java.lang.String"/>
	</class>

	<!-- Named Queries SQL -->
	<sql-query name="Census_Ingest_Processing.Transform_Ack_Build" callable="true" >
		<return class="gov.va.med.cds.scheduler.persistence.CensusAcknowledgementResponse">
			<return-property name="censusMasterId" column="CENSUS_MASTER_ID" />
			<return-property name="messageControlId" column="REQUEST_ID" />
			<return-property name="sendingApplication" column="SENDING_APPLICATION" />
			<return-property name="stationNumber" column="STATION_NUMBER" />
			<return-property name="sendingFacility" column="SENDING_FACILITY" />
			<return-property name="receivingApplication" column="RECEIVING_APPLICATION" />
			<return-property name="receivingFacility" column="RECEIVING_FACILITY" />
			<return-property name="transformStatus" column="TRANSFORM_STATUS" />
			<return-property name="errorMessage" column="MESSAGE" />
	 	</return>
		{ call Census_Ingest_Processing.Transform_Ack_Build( ? ) }
	</sql-query>
	
	<sql-query name="Census_Ingest_Processing.Transform_Ack_Complete" callable="true" >
		<return class="gov.va.med.cds.scheduler.persistence.CensusAppAckUpdateResponse">
	   		<return-property name="censusMasterId" column="CENSUS_MASTER_ID" />
	   		<return-property name="message" column="MESSAGE" />
	   	</return>
		{ call Census_Ingest_Processing.Transform_Ack_Complete( ?, :censusMasterId, :ackFlag ) }
	</sql-query>

</hibernate-mapping>
