<?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">

<hibernate-mapping default-lazy="false" default-cascade="all">
    <class name="gov.va.med.cds.clinicaldata.EntryFilter" table="ENTRY_FILTER" lazy="false">
        <id type="java.lang.Long" >
            <column name="ENTRY_FILTER_ID" />
 			<generator class="sequence">
				<param name="sequence">entry_filter_seq_id</param>
			</generator>
        </id>

		<property name="xpath" column="XPATH" type="java.lang.String" />

 		<many-to-one name="domainEntryPointWrapper"
 					 class="gov.va.med.cds.clinicaldata.DomainEntryPointWrapper" >
			<column name="DOMAIN_ENTRY_POINT_ID" />
		</many-to-one>

    </class>



    <query name="EntryFilterDomainXpath">
		<![CDATA[
		from EntryFilter ef
		left join fetch ef.domainEntryPointWrapper dep
		where ef.xpath = :xpath
		and dep = :depw
      ]]>
	</query>
	
    <query name="EntryFilterDomainNullXpath">
		<![CDATA[
		from EntryFilter ef
		left join fetch ef.domainEntryPointWrapper dep
		where ef.xpath is null
		and dep = :depw
      ]]>
	</query>
	
	<!-- 
		and dep.name = :name
		and dep.domain = :domain
	
	 -->
	
</hibernate-mapping>
