<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

   <ejb-jar>
      <description>Orders Domain</description>
      <display-name>Orders</display-name>
      <enterprise-beans>
         <entity>
            <description>OrderLine Entity Bean</description>
            <display-name>OrderLineEnt</display-name>
            <ejb-name>OrderLineEnt</ejb-name>
            <local-home>org.spec.jappserver.orders.orderlineent.ejb.OrderLineEntHomeLocal</local-home>
            <local>org.spec.jappserver.orders.orderlineent.ejb.OrderLineEntLocal</local>
            <ejb-class>org.spec.jappserver.orders.orderlineent.ejb.OrderLineCmp20EJB</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>org.spec.jappserver.orders.orderlineent.ejb.OrderLineEntPK</prim-key-class>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>OrderLineEnt</abstract-schema-name>
            <cmp-field>
               <field-name>shipDate</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>quantity</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>itemId</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>orderId</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>id</field-name>
            </cmp-field>
            <cmp-field>
            	<field-name>totalValue</field-name>
            </cmp-field>
            <cmp-field>
            	<field-name>olineStatus</field-name>
            </cmp-field>
            <cmp-field>
            	<field-name>msrpAtPurchase</field-name>
            </cmp-field>
            <env-entry>       
               <description>The debug level of the bean - higher
		value means more information.</description>
               <env-entry-name>debuglevel</env-entry-name>
               <env-entry-type>java.lang.Integer</env-entry-type>
               <env-entry-value>0</env-entry-value>
            </env-entry>
            <query>
               <query-method>
                  <method-name>findByOrder</method-name>
                  <method-params>
                     <method-param>java.lang.Integer</method-param>
                  </method-params>
               </query-method>
               <ejb-ql>SELECT OBJECT(a) FROM OrderLineEnt AS a WHERE a.orderId = ?1</ejb-ql>
            </query>
            <query>
               <query-method>
                  <method-name>findByOrderAndItem</method-name>
                  <method-params>
                     <method-param>java.lang.Integer</method-param>
                     <method-param>java.lang.String</method-param>
                  </method-params>
               </query-method>
               <ejb-ql>SELECT OBJECT(a) FROM OrderLineEnt AS a WHERE a.orderId = ?1 and a.itemId = ?2</ejb-ql>
            </query>
         </entity>
         <session>
            <description>Order Session Bean</description>
            <display-name>OrderSes</display-name>
            <ejb-name>OrderSes</ejb-name>
            <home>org.spec.jappserver.orders.orderses.ejb.OrderSesHome</home>
            <remote>org.spec.jappserver.orders.orderses.ejb.OrderSes</remote>
            <local-home>org.spec.jappserver.orders.orderses.ejb.OrderSesHomeLocal</local-home>
            <local>org.spec.jappserver.orders.orderses.ejb.OrderSesLocal</local>
            <ejb-class>org.spec.jappserver.orders.orderses.ejb.OrderSesEJB</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
            <env-entry>
               <description>The debug level of the bean - higher
		value means more information.</description>
               <env-entry-name>debuglevel</env-entry-name>
               <env-entry-type>java.lang.Integer</env-entry-type>
               <env-entry-value>0</env-entry-value>
            </env-entry>
            <ejb-ref>
            	<description></description>
            	<ejb-ref-name>ejb/CustomerSes</ejb-ref-name>
            	<ejb-ref-type>Session</ejb-ref-type>
            	<home>org.spec.jappserver.corp.customerses.ejb.CustomerSesHome</home>
            	<remote>org.spec.jappserver.corp.customerses.ejb.CustomerSes</remote>
            	<ejb-link>CustomerSes</ejb-link>
            </ejb-ref>
            <ejb-local-ref>
               <description>Order Entity Bean</description>
               <ejb-ref-name>ejb/OrderEntLocal</ejb-ref-name>
               <ejb-ref-type>Entity</ejb-ref-type>
               <local-home>org.spec.jappserver.orders.orderent.ejb.OrderEntHomeLocal</local-home>
               <local>org.spec.jappserver.orders.orderent.ejb.OrderEntLocal</local>
               <ejb-link>OrderEnt</ejb-link>
            </ejb-local-ref>
            <ejb-local-ref>
            	<description></description>
            	<ejb-ref-name>ejb/ItemEntLocal</ejb-ref-name>
            	<ejb-ref-type>Entity</ejb-ref-type>
            	<local-home>org.spec.jappserver.orders.itement.ejb.ItemEntHomeLocal</local-home>
            	<local>org.spec.jappserver.orders.itement.ejb.ItemEntLocal</local>
            	<ejb-link>ItemEnt</ejb-link>
            </ejb-local-ref>
            <resource-ref>
            	<description></description>
            	<res-ref-name>jms/QueueConnectionFactory</res-ref-name>
            	<res-type>javax.jms.QueueConnectionFactory</res-type>
            	<res-auth>Application</res-auth>
            	<res-sharing-scope>Shareable</res-sharing-scope>
            </resource-ref>
            <resource-env-ref>
            	<description></description>
            	<resource-env-ref-name>jms/LargeOrderQueue</resource-env-ref-name>
            	<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
            </resource-env-ref>
         </session>
         <entity>
            <description>Item Entity bean</description>
            <display-name>ItemEnt</display-name>
            <ejb-name>ItemEnt</ejb-name>
            <local-home>org.spec.jappserver.orders.itement.ejb.ItemEntHomeLocal</local-home>
            <local>org.spec.jappserver.orders.itement.ejb.ItemEntLocal</local>
            <ejb-class>org.spec.jappserver.orders.itement.ejb.ItemCmp20EJB</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.String</prim-key-class>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>ItemEnt</abstract-schema-name>
            <cmp-field>
            	<field-name>discount</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>description</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>name</field-name>
            </cmp-field>
            <cmp-field>
            	<field-name>price</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>category</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>id</field-name>
            </cmp-field>
            <primkey-field>id</primkey-field>
            <env-entry>
               <description>The debug level of the bean - higher
		value means more information.</description>
               <env-entry-name>debuglevel</env-entry-name>
               <env-entry-type>java.lang.Integer</env-entry-type>
               <env-entry-value>0</env-entry-value>
            </env-entry>
            <query>
               <query-method>
                  <method-name>findByCategory</method-name>
                  <method-params>
                     <method-param>int</method-param>
                  </method-params>
               </query-method>
               <ejb-ql>SELECT OBJECT(a) FROM ItemEnt AS a WHERE a.category = ?1</ejb-ql>
            </query>
         </entity>
         <entity>
            <description>Order Entity Bean</description>
            <display-name>OrderEnt</display-name>
            <ejb-name>OrderEnt</ejb-name>
            <local-home>org.spec.jappserver.orders.orderent.ejb.OrderEntHomeLocal</local-home>
            <local>org.spec.jappserver.orders.orderent.ejb.OrderEntLocal</local>
            <ejb-class>org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.Integer</prim-key-class>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>OrderEnt</abstract-schema-name>
            <cmp-field>
               <field-name>orderStatus</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>shipDate</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>entryDate</field-name>
            </cmp-field>
            <cmp-field>
            	<field-name>total</field-name>
            </cmp-field>
            <cmp-field>
            	<field-name>discount</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>orderLineCount</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>customerId</field-name>
            </cmp-field>
            <cmp-field>
               <field-name>id</field-name>
            </cmp-field>
            <primkey-field>id</primkey-field>
            <env-entry>
               <description>The debug level of the bean - higher
		value means more information.</description>
               <env-entry-name>debuglevel</env-entry-name>
               <env-entry-type>java.lang.Integer</env-entry-type>
               <env-entry-value>0</env-entry-value>
            </env-entry>
            <ejb-ref>
               <description>the Sequence Session Bean</description>
               <ejb-ref-name>ejb/SequenceSes</ejb-ref-name>
               <ejb-ref-type>Session</ejb-ref-type>
               <home>org.spec.jappserver.util.sequenceses.ejb.SequenceSesHome</home>
               <remote>org.spec.jappserver.util.sequenceses.ejb.SequenceSes</remote>
               <ejb-link>SequenceSes</ejb-link>
            </ejb-ref>
            <ejb-local-ref>
               <ejb-ref-name>ejb/ItemEntLocal</ejb-ref-name>
               <ejb-ref-type>Entity</ejb-ref-type>
               <local-home>org.spec.jappserver.orders.itement.ejb.ItemEntHomeLocal</local-home>
               <local>org.spec.jappserver.orders.itement.ejb.ItemEntLocal</local>
               <ejb-link>ItemEnt</ejb-link>
            </ejb-local-ref>
            <ejb-local-ref>
               <ejb-ref-name>ejb/OrderLineEntLocal</ejb-ref-name>
               <ejb-ref-type>Entity</ejb-ref-type>
               <local-home>org.spec.jappserver.orders.orderlineent.ejb.OrderLineEntHomeLocal</local-home>
               <local>org.spec.jappserver.orders.orderlineent.ejb.OrderLineEntLocal</local>
               <ejb-link>OrderLineEnt</ejb-link>
            </ejb-local-ref>
            <query>
               <query-method>
                  <method-name>findByCustomer</method-name>
                  <method-params>
                     <method-param>int</method-param>
                  </method-params>
               </query-method>
               <ejb-ql>SELECT OBJECT(a) FROM OrderEnt AS a WHERE a.customerId = ?1</ejb-ql>
            </query>
            <query>
            	<description>returns all open orders</description>
            	<query-method>
            		<method-name>findOpenOrdersByCustomer</method-name>
            		<method-params>
            			<method-param>java.lang.Integer</method-param>
            		</method-params>
            	</query-method>
            	<ejb-ql>select object(o) from OrderEnt o where o.customerId = ?1 AND (o.orderStatus = 1 OR o.orderStatus = 2)</ejb-ql>
            </query>
         </entity>
         <session>
            <description>Orders Auditing Session Bean</description>
            <display-name>OrderAuditSes</display-name>
            <ejb-name>OrderAuditSes</ejb-name>
            <home>org.spec.jappserver.orders.orderauditses.ejb.OrderAuditSesHome</home>
            <remote>org.spec.jappserver.orders.orderauditses.ejb.OrderAuditSes</remote>
            <ejb-class>org.spec.jappserver.orders.orderauditses.ejb.OrderAuditSesEJB</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
            <env-entry>
               <description>The debug level of the bean - higher
                value means more information.</description>
               <env-entry-name>debuglevel</env-entry-name>
               <env-entry-type>java.lang.Integer</env-entry-type>
               <env-entry-value>0</env-entry-value>
            </env-entry>
            <env-entry>
            	<description>The SQL query used to update the o_item table for the cache consistency test</description>
            	<env-entry-name>cacheTestQuery</env-entry-name>
            	<env-entry-type>java.lang.String</env-entry-type>
            	<env-entry-value>update O_item set i_price = ? where i_id = ?</env-entry-value>
            </env-entry>	    
            <resource-ref>
               <description>Order DB dataSource</description>
               <res-ref-name>OrdersDataSource</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
            </resource-ref>
         </session>
         <session>
         	<ejb-name>ItemBrowserSes</ejb-name>
         	<home>org.spec.jappserver.orders.itemBrowserSes.ejb.ItemBrowserSesHome</home>
         	<remote>org.spec.jappserver.orders.itemBrowserSes.ejb.ItemBrowserSes</remote>
         	<local-home>org.spec.jappserver.orders.itemBrowserSes.ejb.ItemBrowserSesHomeLocal</local-home>
         	<local>org.spec.jappserver.orders.itemBrowserSes.ejb.ItemBrowserSesLocal</local>
         	<ejb-class>org.spec.jappserver.orders.itemBrowserSes.ejb.ItemBrowserSesEJB</ejb-class>
         	<session-type>Stateful</session-type>
         	<transaction-type>Container</transaction-type>
         	<env-entry>
         		<env-entry-name>debuglevel</env-entry-name>
         		<env-entry-type>java.lang.Integer</env-entry-type>
         		<env-entry-value>0</env-entry-value>
         	</env-entry>
         	<ejb-local-ref>
         		<description></description>
         		<ejb-ref-name>ejb/ItemEntLocal</ejb-ref-name>
         		<ejb-ref-type>Entity</ejb-ref-type>
         		<local-home>org.spec.jappserver.orders.itement.ejb.ItemEntHomeLocal</local-home>
         		<local>org.spec.jappserver.orders.itement.ejb.ItemEntLocal</local>
         		<ejb-link>ItemEnt</ejb-link>
         	</ejb-local-ref>
         </session>
         <message-driven>
         	<display-name>FulfillOrderMDB</display-name>
         	<ejb-name>FulfillOrderMDB</ejb-name>
         	<ejb-class>org.spec.jappserver.orders.fulfillordermdb.ejb.FulfillOrderMDB</ejb-class>
         	<transaction-type>Container</transaction-type>
         	<message-driven-destination>
         		<destination-type>javax.jms.Queue</destination-type>
         	</message-driven-destination>
         	<env-entry>
               <description>
                  The debug level of the bean - higher
                  value means more information.
               </description>
               <env-entry-name>debuglevel</env-entry-name>
               <env-entry-type>java.lang.Integer</env-entry-type>
               <env-entry-value>0</env-entry-value>
            </env-entry>
         	<ejb-ref>
         		<description></description>
         		<ejb-ref-name>ejb/CustomerSes</ejb-ref-name>
         		<ejb-ref-type>Session</ejb-ref-type>
         		<home>org.spec.jappserver.corp.customerses.ejb.CustomerSesHome</home>
         		<remote>org.spec.jappserver.corp.customerses.ejb.CustomerSes</remote>
         		<ejb-link>CustomerSes</ejb-link>
         	</ejb-ref>
         	<ejb-local-ref>
         		<description></description>
         		<ejb-ref-name>ejb/OrderLineEntLocal</ejb-ref-name>
         		<ejb-ref-type>Entity</ejb-ref-type>
         		<local-home>org.spec.jappserver.orders.orderlineent.ejb.OrderLineEntHomeLocal</local-home>
         		<local>org.spec.jappserver.orders.orderlineent.ejb.OrderLineEntLocal</local>
         		<ejb-link>OrderLineEnt</ejb-link>
         	</ejb-local-ref>
         	<ejb-local-ref>
         		<description></description>
         		<ejb-ref-name>ejb/OrderEntLocal</ejb-ref-name>
         		<ejb-ref-type>Entity</ejb-ref-type>
         		<local-home>org.spec.jappserver.orders.orderent.ejb.OrderEntHomeLocal</local-home>
         		<local>org.spec.jappserver.orders.orderent.ejb.OrderEntLocal</local>
         		<ejb-link>OrderEnt</ejb-link>
         	</ejb-local-ref>
         </message-driven>
      </enterprise-beans>
      <relationships>
         <ejb-relation>
            <description>Order-OrderLine</description>
            <ejb-relation-name>Order-OrderLine</ejb-relation-name>
            <ejb-relationship-role>
               <ejb-relationship-role-name>Order-has-many-OrderLine</ejb-relationship-role-name>
               <multiplicity>One</multiplicity>
               <relationship-role-source>
                  <ejb-name>OrderEnt</ejb-name>
               </relationship-role-source>
               <cmr-field>
                  <cmr-field-name>ordLines</cmr-field-name>
                  <cmr-field-type>java.util.Collection</cmr-field-type>
               </cmr-field>
            </ejb-relationship-role>
            <ejb-relationship-role>
               <ejb-relationship-role-name>OrderLine-belongs-to-Order</ejb-relationship-role-name>
               <multiplicity>Many</multiplicity>
               <cascade-delete></cascade-delete>
               <relationship-role-source>
                  <ejb-name>OrderLineEnt</ejb-name>
               </relationship-role-source>
            </ejb-relationship-role>
         </ejb-relation>
      </relationships>
      <assembly-descriptor>
         <container-transaction>
            <method>
               <ejb-name>OrderLineEnt</ejb-name>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
         <container-transaction>
            <method>
               <ejb-name>OrderSes</ejb-name>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
         <container-transaction>
            <method>
               <ejb-name>ItemEnt</ejb-name>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
         <container-transaction>
            <method>
               <ejb-name>OrderEnt</ejb-name>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
         <container-transaction>
            <method>
               <ejb-name>OrderAuditSes</ejb-name>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
         <container-transaction>
            <method>
               <ejb-name>ItemBrowserSes</ejb-name>
               <method-name>*</method-name>                   
            </method>                                         
            <trans-attribute>Supports</trans-attribute>       
         </container-transaction>                             
         <container-transaction>                              
            <method>                                          
               <ejb-name>ItemBrowserSes</ejb-name>                       
               <method-name>getItems</method-name>
            </method>
            <method>                                          
               <ejb-name>ItemBrowserSes</ejb-name>                       
               <method-name>browseForward</method-name>
            </method>
            <method>                                          
               <ejb-name>ItemBrowserSes</ejb-name>                       
               <method-name>browseReverse</method-name>
            </method>                        
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
         <container-transaction>
            <method>
               <ejb-name>FulfillOrderMDB</ejb-name>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
      </assembly-descriptor>
   </ejb-jar>
