<?xml version="1.0" encoding="UTF-8" ?>
<!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="all"
    package="gov.va.med.esr.common.model.person">

    <class name="EmergencyResponseIndicator"
        table="EMERGENCY_RESPONSE">

        <id name="identifier"
            type="big_decimal"
            column="EMERGENCY_RESPONSE_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"/>

        <many-to-one name="person" lazy="false" class="Person" cascade="none">
			<column name="PERSON_ID" not-null="true"/>
        </many-to-one>

        <many-to-one name="emergencyResponse" class="gov.va.med.esr.common.model.lookup.EmergencyResponse"
            outer-join="false" cascade="none" column="STD_EMERGENCYRESPONSE_ID" />
            		
        <property name="createdOn" column="RECORD_CREATED_DATE" type="timestamp" not-null="true" update="false"/>
        <property name="modifiedOn" column="RECORD_MODIFIED_DATE" type="timestamp" not-null="true"/>
		<property name="createdBy" column="RECORD_CREATED_BY" update="false" type="gov.va.med.fw.persistent.hibernate.AuditUserType"/> 
		<property name="modifiedBy" column="RECORD_MODIFIED_BY" type="gov.va.med.fw.persistent.hibernate.AuditUserType"/>
    </class>
</hibernate-mapping>
