<?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"
    auto-import="true"
    default-access="property"
    default-cascade="none"
    package="gov.va.med.esr.common.model.messaging">

    <class 
        name="MsdsMessagePayloadEntry" 
        table="BROKER_SERVICE_PAYLOAD"> 

		<id name="identifier" type="big_decimal" column="BROKER_SERVICE_PAYLOAD_ID">
			<generator 
				class="gov.va.med.fw.persistent.hibernate.BigSequenceGenerator">
				<param name="sequence">transaction_s</param>
			</generator>
		</id>
		
		<version name="version" type="integer" column="RECORD_MODIFIED_COUNT"/>

		<property
            name="msdsMessageLogId"
            type="big_decimal"
            column="BROKER_SERVICE_LOG_ID" /> 

        <property
            name="request"
            type="org.springframework.orm.hibernate3.support.ClobStringType"
            update="false"
            column="REQUEST_PAYLOAD"/>

        <property
            name="response"
            type="org.springframework.orm.hibernate3.support.ClobStringType"
            column="RESPONSE_PAYLOAD"/>            
		
		<property 
			name="createdOn" 
			type="timestamp" 
			column="RECORD_CREATED_DATE" 
			update="false"/>
			
		<property 
			name="modifiedOn" 
			type="timestamp" 
			column="RECORD_MODIFIED_DATE" />			
		
		<property 
			name="createdBy" 
			type="gov.va.med.fw.persistent.hibernate.AuditUserType" 
			column="RECORD_CREATED_BY"/>
			
		<property 
			name="modifiedBy" 
			type="gov.va.med.fw.persistent.hibernate.AuditUserType" 
			column="RECORD_MODIFIED_BY"/>
					
    </class>

	<query name="MsdsMessagePayloadEntryQuery_Identifier">
        FROM   MsdsMessagePayloadEntry mle
        WHERE  mle.identifier = :identifier
    </query>
    <query name="MsdsMessagePayloadEntryQuery_FindByMsdsMessageLogId">
        FROM     MsdsMessagePayloadEntry mle
        WHERE    mle.msdsMessageLogId = :msdsMessageLogId
    </query>      	
</hibernate-mapping>
