<?xml version="1.0" encoding="UTF-8"?>

<!--
 Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved.
 Use is subject to license terms.
-->

<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
  <display-name>Ejb1</display-name>
  <enterprise-beans>
    <entity>
      <ejb-name>AddressBean</ejb-name>
      <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalAddressHome</local-home>
      <local>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalAddress</local>
      <ejb-class>samples.ejb.cmp.cmpcustomer.ejb.customer.AddressBean</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>Address</abstract-schema-name>
      <cmp-field>
        <field-name>addressID</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>street</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>state</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>zip</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>city</field-name>
      </cmp-field>
      <primkey-field>addressID</primkey-field>
      <ejb-local-ref>
        <ejb-ref-name>ejb/CustomerRef</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalCustomerHome</local-home>
        <local>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalCustomer</local>
        <ejb-link>CustomerBean</ejb-link>
      </ejb-local-ref>
      <security-identity>
        <use-caller-identity/>
      </security-identity>
    </entity>
    <entity>
      <ejb-name>CustomerBean</ejb-name>
      <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalCustomerHome</local-home>
      <local>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalCustomer</local>
      <ejb-class>samples.ejb.cmp.cmpcustomer.ejb.customer.CustomerBean</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>Customer</abstract-schema-name>
      <cmp-field>
        <field-name>customerID</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>firstName</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>lastName</field-name>
      </cmp-field>
      <primkey-field>customerID</primkey-field>
      <ejb-local-ref>
        <ejb-ref-name>ejb/SubscriptionRef</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalSubscriptionHome</local-home>
        <local>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalSubscription</local>
        <ejb-link>SubscriptionBean</ejb-link>
      </ejb-local-ref>
      <ejb-local-ref>
        <ejb-ref-name>ejb/AddressRef</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalAddressHome</local-home>
        <local>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalAddress</local>
        <ejb-link>AddressBean</ejb-link>
      </ejb-local-ref>
      <security-identity>
        <use-caller-identity/>
      </security-identity>
      <query>
        <query-method>
          <method-name>findByLastName</method-name>
          <method-params>
            <method-param>java.lang.String</method-param>
          </method-params>
        </query-method>
        <ejb-ql>SELECT DISTINCT OBJECT(c) FROM Customer c WHERE c.lastName= ?1</ejb-ql>
      </query>
      <query>
        <query-method>
          <method-name>findByFirstName</method-name>
          <method-params>
            <method-param>java.lang.String</method-param>
          </method-params>
        </query-method>
        <ejb-ql>SELECT DISTINCT OBJECT(c) FROM Customer AS c WHERE c.firstName = ?1</ejb-ql>
      </query>
    </entity>
    <entity>
      <ejb-name>SubscriptionBean</ejb-name>
      <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalSubscriptionHome</local-home>
      <local>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalSubscription</local>
      <ejb-class>samples.ejb.cmp.cmpcustomer.ejb.customer.SubscriptionBean</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>Subscription</abstract-schema-name>
      <cmp-field>
        <field-name>title</field-name>
      </cmp-field>
      <cmp-field>
        <field-name>type</field-name>
      </cmp-field>
      <primkey-field>title</primkey-field>
      <ejb-local-ref>
        <ejb-ref-name>ejb/CustomerRef</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalCustomerHome</local-home>
        <local>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalCustomer</local>
        <ejb-link>CustomerBean</ejb-link>
      </ejb-local-ref>
      <security-identity>
        <use-caller-identity/>
      </security-identity>
      <query>
        <query-method>
          <method-name>findAllSubscriptions</method-name>
          <method-params/>
        </query-method>
        <ejb-ql>SELECT DISTINCT OBJECT(s) FROM Subscription s</ejb-ql>
      </query>
    </entity>
  </enterprise-beans>
  <relationships>
    <ejb-relation>
      <ejb-relationship-role>
        <ejb-relationship-role-name>CustomerBean-AddressBean</ejb-relationship-role-name>
        <multiplicity>One</multiplicity>
        <relationship-role-source>
          <ejb-name>CustomerBean</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>addresses</cmr-field-name>
          <cmr-field-type>java.util.Collection</cmr-field-type>
        </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
        <ejb-relationship-role-name>AddressBean-CustomerBean</ejb-relationship-role-name>
        <multiplicity>Many</multiplicity>
        <cascade-delete/>
        <relationship-role-source>
          <ejb-name>AddressBean</ejb-name>
        </relationship-role-source>
      </ejb-relationship-role>
    </ejb-relation>
    <ejb-relation>
      <ejb-relationship-role>
        <ejb-relationship-role-name>CustomerBean-SubscriptionBean</ejb-relationship-role-name>
        <multiplicity>Many</multiplicity>
        <relationship-role-source>
          <ejb-name>CustomerBean</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>subscriptions</cmr-field-name>
          <cmr-field-type>java.util.Collection</cmr-field-type>
        </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
        <ejb-relationship-role-name>SubscriptionBean-CustomerBean</ejb-relationship-role-name>
        <multiplicity>Many</multiplicity>
        <relationship-role-source>
          <ejb-name>SubscriptionBean</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>customers</cmr-field-name>
          <cmr-field-type>java.util.Collection</cmr-field-type>
        </cmr-field>
      </ejb-relationship-role>
    </ejb-relation>
  </relationships>
  <assembly-descriptor>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getZip</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>remove</method-name>
        <method-params>
          <method-param>java.lang.Object</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getStreet</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>findByPrimaryKey</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getCity</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>remove</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>create</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
          <method-param>java.lang.String</method-param>
          <method-param>java.lang.String</method-param>
          <method-param>java.lang.String</method-param>
          <method-param>java.lang.String</method-param>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getState</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>AddressBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getAddressID</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>remove</method-name>
        <method-params>
          <method-param>java.lang.Object</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>removeSubscription</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getCustomerID</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>findByLastName</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>addAddress</method-name>
        <method-params>
          <method-param>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalAddress</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>create</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
          <method-param>java.lang.String</method-param>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>findByPrimaryKey</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>addSubscription</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getLastName</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getFirstName</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>remove</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>findByFirstName</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getSubscriptionList</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>addSubscription</method-name>
        <method-params>
          <method-param>samples.ejb.cmp.cmpcustomer.ejb.customer.LocalSubscription</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>CustomerBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getAddressList</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>remove</method-name>
        <method-params>
          <method-param>java.lang.Object</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>findByPrimaryKey</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getTitle</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>create</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
          <method-param>samples.ejb.cmp.cmpcustomer.ejb.customer.SubscriptionType</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getCustomerList</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>remove</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>findAllSubscriptions</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>LocalHome</method-intf>
        <method-name>create</method-name>
        <method-params>
          <method-param>java.lang.String</method-param>
          <method-param>java.lang.String</method-param>
        </method-params>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
      <method>
        <ejb-name>SubscriptionBean</ejb-name>
        <method-intf>Local</method-intf>
        <method-name>getType</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
  </assembly-descriptor>
</ejb-jar>