<?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
    auto-import="true"
    default-access="property"
    default-cascade="all"
	default-lazy="false"
    package="gov.va.med.ps.model"
	schema="PSIM">

    <class
        name="PersonVPID"
		mutable="false"
        table="PS_PERSON_VPID">

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

		<!-- BOM specific -->
        <property
            name="vpidValue"
            type="string"
            column="VPID_VALUE"/>

         <property
            name="idStateInd"
            type="string"
            column="ID_STATE_IND"/>          

         <property
            name="idUpdatEventDate"
            type="timestamp"
            column="IDENTITY_UPDATE_EVENT_DATE"/>          

         <property
            name="idTxnType"
            type="string"
            column="IDENTITY_TRANSACTION_TYPE"/>   
            
            
		<!-- ADR specific -->
        <property
            name="createdOn"
            type="timestamp"
			update="false"
            column="RECORD_CREATED_DATE"/>

        <property
            name="createdBy"
            type="gov.va.med.fw.persistent.hibernate.AuditUserType"
            column="RECORD_CREATED_BY"/>

        <property
            name="modifiedOn"
            type="timestamp"
            column="RECORD_MODIFIED_DATE"/>

        <property
            name="modifiedBy"
            type="gov.va.med.fw.persistent.hibernate.AuditUserType"
            column="RECORD_MODIFIED_BY"/>		
						
    </class>
	
    <query name="getAll">
        FROM   PersonVPID
    </query>
    <query name="personVPID_GetByVPID">
        FROM   PersonVPID p
        WHERE  p.vpidValue = :VPIDValue
    </query>
	
	

</hibernate-mapping>