<?xml version="1.0"?>

<!-- <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">  -->


<orion-ejb-jar deployment-version="1.0.2.2" deployment-time="ea013a2eda">

	<enterprise-beans>
		<!--
			********************Settings related to Hotel Entity Bean*********************

		-->

		<!--
			entity-deployment Element:

				Deployment info for an entity bean.
				location =  the JNDI location name for the  Entity Bean
				"table"    =Set to Hotels which will prevent oc4j from using auto-create functionality.
		-->


		<entity-deployment name="HotelHome" location="HotelHome" wrapper="HotelHome_EntityHomeWrapper5" table="Hotels" data-source="jdbc/OracleDS">
			<cmp-field-mapping name="m_hotelID" persistence-name="ID" />

			<!--
				The following section is for persisting HotelFacilties collection in database table hotel_facilities.
				hotel_facilties is an object of type Collection which contains HotelFacilty objects.

				The object to be persisted(HotelFacility) must contain a no-argument constructor as well as it must implement java.io.Serializable

				list-mapping Element:
					Specifies a relational mapping of a List type. A List is a sequential (where order/index is important) Collection of items.
					The field containing the mapping must be of type java.util.List or the legacy types java.util.Vector or Type[].

				value-mapping Element:

					Specifies mapping of set of fields.

				primkey-mapping Element:
					Specifies a mapping of the primary key part of a set of fields.
			-->

			<cmp-field-mapping name="m_facilities">
				<list-mapping table="hotel_facilities">

					<primkey-mapping>
						<cmp-field-mapping name="m_hotelID" persistence-name="HOT_ID" />
					</primkey-mapping>
					<value-mapping type="oracle.otnsamples.CMPSample.utils.HotelFacility">
						<cmp-field-mapping>
							<fields>
								  <cmp-field-mapping name="m_facilityType" persistence-name="FACILITY_TYPE" />
								   <cmp-field-mapping name="m_name"  persistence-name="FACILITY_TYPE_NAME" />
							         <cmp-field-mapping name="m_text" persistence-name="FACILITY_TEXT " />

							  </fields>
						</cmp-field-mapping>
					</value-mapping>
				</list-mapping>
			</cmp-field-mapping>

			<!--
				The following section is for persisting m_availableRoomTypes collection in database table available_room_types.
				m_availableRoomTypes is an object of type Collection which contains AvailableRoomType objects.
				The object to be persisted(AvailableRoomType) must contain a no-argument constructor as well as it must implement java.io.Serializable


				list-mapping Element:
						Specifies a relational mapping of a List type. A List is a sequential (where order/index is important) Collection of items.
						The field containing the mapping must be of type java.util.List or the legacy types java.util.Vector or Type[].

				value-mapping Element:
						Specifies mapping of set of fields.

				primkey-mapping Element:
						Specifies a mapping of the primary key part of a set of fields.
			-->


			<cmp-field-mapping name="m_availableRoomTypes">
				<list-mapping table="available_room_types">
					<primkey-mapping>
						<cmp-field-mapping name="m_hotelID" persistence-name="HOT_ID" />
					</primkey-mapping>
					<value-mapping type="oracle.otnsamples.CMPSample.utils.AvailableRoomType">
						<cmp-field-mapping>
							<fields>
								  <cmp-field-mapping name="m_standardRate"  persistence-name="STANDARD_RATE" />
								  <cmp-field-mapping name="m_roomType"  persistence-name="ROOM_TYPE" />
							          <cmp-field-mapping name="m_currency" persistence-name="CURRENCY" />

							          <cmp-field-mapping name="m_roomAmenities" persistence-name="ROOM_AMENITIES" />
							  </fields>
							</cmp-field-mapping>
					</value-mapping>
				</list-mapping>
			</cmp-field-mapping>

			<!--
				cmp-field-mapping Element:
					Deployment info for a container-managed persistence field. If no subtags defining different behaviour is specified
					the field is persisted thru serialization or native handling of "recognized" primitive types.
						name = name of the variable in the bean
					persistence-name =name of column in the database

			-->
			<cmp-field-mapping name="m_hotelDetails">
				  <fields>
						<cmp-field-mapping name="m_hotelName" persistence-name="NAME" />
						<cmp-field-mapping name="m_city" persistence-name="CTY_ID" />
						<cmp-field-mapping name="m_location" persistence-name="LOCATION" />
						<cmp-field-mapping name="m_hotelAddress" persistence-name="ADDRESS" />
						<cmp-field-mapping name="m_phone" persistence-name="PHONE" />
						<cmp-field-mapping name="m_hotCode" persistence-name="HOC_CODE" />
						<cmp-field-mapping name="m_hotelURL" persistence-name="HOTEL_URL" />
						<cmp-field-mapping name="m_fax" persistence-name="FAX" />
						<cmp-field-mapping name="m_hotelAirport" persistence-name="HOTEL_AIRPORT" />
				  </fields>
			</cmp-field-mapping>


			<primkey-mapping>
				<cmp-field-mapping name="m_hotelID" persistence-name="ID" />
			</primkey-mapping>
			<resource-ref-mapping name="jdbc/OracleCoreDS" />
		</entity-deployment>
	</enterprise-beans>
	<assembly-descriptor>
		<default-method-access>
			<security-role-mapping name="&lt;default-ejb-caller-role&gt;" impliesAll="true" />
		</default-method-access>
	</assembly-descriptor>
</orion-ejb-jar>

