<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[
<!ENTITY managedPractitionerLite SYSTEM "classpath://gov/va/med/cds/persistence/hibernate/tiu/TiuManagedPractitionerParticipationLite.hbm">
<!ENTITY practitionerLite        SYSTEM "classpath://gov/va/med/cds/persistence/hibernate/tiu/TiuPractitionerLite.hbm">
]
>

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

	<!-- 
		Table TIU_PRACT_PART has a DISCRIMINATOR field like in ALLERGY_PRACT_PART.  Valid values are:

			‘OCS’ for Other Cosigners
			‘OEC’ for Other Expected Cosigners
			NULL for the 0..1 practitioners
	-->

	<class table="TIU_PRACT_PART_V"  
	 	   entity-name="otherExpectedCosigners"
	 	   lazy="false"
	 	   discriminator-value="OEC"
           node="otherExpectedCosigners">
		
		<id name="id" type="java.lang.Long">
			<column name="TIU_PRACT_PART_ID" />
			<generator class="sequence">
				<param name="sequence">TIU_PRACT_PART_SEQ_ID</param>
			</generator>
		</id>
    
    
&practitionerLite;

       <property name="clinicalDocumentId" type="integer" column="CLINICAL_DOCUMENT_ID" node="clinicalDocumentId" insert="false" update="false"/>
       <property name="discriminator" type="string" column="DISCRIMINATOR"/>
    </class>


	<class table="TIU_PRACT_PART_V" lazy="false" 
	 	   entity-name="otherCosigners" discriminator-value="OCS" node="otherCosigners">
		
		<id name="id" type="java.lang.Long">
			<column name="TIU_PRACT_PART_ID" />
			<generator class="sequence">
				<param name="sequence">TIU_PRACT_PART_SEQ_ID</param>
			</generator>
		</id>

&managedPractitionerLite;

       <property name="clinicalDocumentId" type="integer" column="CLINICAL_DOCUMENT_ID" node="clinicalDocumentId" insert="false" update="false"/>
       <property name="discriminator" type="string" column="DISCRIMINATOR"/>
	</class>



	<class table="TIU_PRACT_PART_V"  
	 	   entity-name="TiuSinglePractitionerLite" discriminator-value="" >
		
		<id name="id" type="java.lang.Long">
			<column name="TIU_PRACT_PART_ID" />
			<generator class="sequence">
				<param name="sequence">TIU_PRACT_PART_SEQ_ID</param>
			</generator>
		</id>
    
&practitionerLite;
        <property name="clinicalDocumentId" type="integer" column="CLINICAL_DOCUMENT_ID" node="clinicalDocumentId"/>
    </class>


	<class table="TIU_PRACT_PART_V" lazy="false" 
	 	   entity-name="TiuSingleManagedPractitionerParticipationLite" discriminator-value="" >
		
		<id name="id" type="java.lang.Long">
			<column name="TIU_PRACT_PART_ID" />
			<generator class="sequence">
				<param name="sequence">TIU_PRACT_PART_SEQ_ID</param>
			</generator>
		</id>

&managedPractitionerLite;
	</class>

</hibernate-mapping>
