<?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 
	package="org.hibernate.test.readonly">

	<class name="DataPoint" 
		dynamic-update="true">
		<!--rowid="rowid"--> <!-- remove this if not oracle -->
		<id name="id">
			<generator class="increment"/>
		</id>
		<property name="x">
			<column name="xval" not-null="true" precision="25" scale="19" unique-key="xy"/>
		</property>
		<property name="y">
			<column name="yval" not-null="true" precision="25" scale="19" unique-key="xy"/>
		</property>
		<property name="description"/>
	</class>

    <class name="Owner">
        <id name="id">
            <generator class="increment"/>
        </id>
        <property name="name" unique="true"/>
    </class>

    <class name="Info">
        <id name="id">
            <generator class="increment"/>
        </id>
        <property name="details"/>
    </class>

    <class name="Container">
        <id name="id">
            <generator class="increment"/>
        </id>
        <property name="name"/>
        <many-to-one name="noProxyOwner" class="Owner" column="no_proxy_owner_name" property-ref="name" lazy="no-proxy" cascade="all"/>
        <many-to-one name="proxyOwner" class="Owner" column="proxy_owner_name" property-ref="name" lazy="proxy" cascade="all"/>
        <many-to-one name="nonLazyOwner" class="Owner" column="non_lazy_owner_name" property-ref="name" lazy="false" cascade="all"/>
        <many-to-one name="noProxyInfo" class="Info" column="no_proxy_info_id" lazy="no-proxy" cascade="all"/>
        <many-to-one name="proxyInfo" class="Info" column="proxy_info_id" lazy="proxy" cascade="all"/>
        <many-to-one name="nonLazyInfo" class="Info" column="non_lazy_info_id" lazy="false" cascade="all"/>
        <set name="lazyDataPoints" lazy="true" inverse="false" cascade="all">
            <key column="c_lazy_id"/>
            <one-to-many class="DataPoint"/>
        </set>
        <set name="nonLazySelectDataPoints" lazy="false" inverse="false" cascade="all" fetch="select">
            <key column="c_non_lazy_select_id"/>
            <one-to-many class="DataPoint"/>
        </set>
        <set name="nonLazyJoinDataPoints" lazy="false" inverse="false" cascade="all" fetch="join">
            <key column="c_non_lazy_join_id"/>
            <one-to-many class="DataPoint"/>
        </set>
    </class>
    
</hibernate-mapping>
