<?xml version="1.0"?>
<!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>
    <enterprise-beans>
        <entity>
            <ejb-name>Area</ejb-name>
            <local-home>faqapp.AreaLocalHome</local-home>
            <local>faqapp.AreaLocal</local>
            <ejb-class>faqapp.AreaBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.Integer</prim-key-class>
            <primkey-field>areaID</primkey-field>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>AreaBean</abstract-schema-name>
            <cmp-field>
                <field-name>areaID</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>areaDesc</field-name>
            </cmp-field>
            <query>
                <query-method>
                    <method-name>findAll</method-name>
                    <method-params>
                    </method-params>
                </query-method>
                <ejb-ql>
                    <![CDATA[SELECT OBJECT(a) FROM AreaBean AS a WHERE a.areaID IS NOT NULL]]>
                </ejb-ql>
            </query>
        </entity>
        <entity>
            <ejb-name>Topic</ejb-name>
            <local-home>faqapp.TopicLocalHome</local-home>
            <local>faqapp.TopicLocal</local>
            <ejb-class>faqapp.TopicBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.Integer</prim-key-class>
            <primkey-field>topicID</primkey-field>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>TopicBean</abstract-schema-name>
            <cmp-field>
                <field-name>topicID</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>topicDesc</field-name>
            </cmp-field>
            <query>
                <query-method>
                    <method-name>findByAreaID</method-name>
                    <method-params>
                        <method-param>java.lang.Integer</method-param>
                    </method-params>
                </query-method>
                <ejb-ql>
                    <![CDATA[SELECT OBJECT(a) FROM TopicBean AS a WHERE a.area.areaID = ?1]]>
                </ejb-ql>
            </query>
            <query>
                <query-method>
                    <method-name>findAll</method-name>
                    <method-params>
                    </method-params>
                </query-method>
                <ejb-ql>
                    <![CDATA[SELECT OBJECT(a) FROM TopicBean AS a WHERE a.topicID IS NOT NULL]]>
                </ejb-ql>
            </query>
        </entity>
        <entity>
            <ejb-name>FAQ</ejb-name>
            <local-home>faqapp.FAQLocalHome</local-home>
            <local>faqapp.FAQLocal</local>
            <ejb-class>faqapp.FAQBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.Integer</prim-key-class>
            <primkey-field>questionID</primkey-field>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>FAQBean</abstract-schema-name>
            <cmp-field>
                <field-name>questionID</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>question</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>answer</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>internalFlag</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>productVersion</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>createdBy</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>creationDate</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>modifiedBy</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>modificationDate</field-name>
            </cmp-field>
            <query>
                <query-method>
                    <method-name>findAll</method-name>
                    <method-params>
                    </method-params>
                </query-method>
                <ejb-ql>
                    <![CDATA[SELECT OBJECT(a) FROM FAQBean AS a WHERE a.questionID IS NOT NULL]]>
                </ejb-ql>
            </query>
            <query>
                <query-method>
                    <method-name>findByAreaID</method-name>
                    <method-params>
                        <method-param>java.lang.Integer</method-param>
                    </method-params>
                </query-method>
                <ejb-ql>
                    <![CDATA[SELECT OBJECT(a) FROM FAQBean AS a, IN(a.areas) AS b WHERE b.areaID = ?1]]>
                </ejb-ql>
            </query>
        </entity>
        <session>
            <ejb-name>AppSessionFacade</ejb-name>
            <home>faqapp.AppSessionFacadeHome</home>
            <remote>faqapp.AppSessionFacade</remote>
            <ejb-class>faqapp.AppSessionFacadeBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
            <ejb-local-ref>
                <description>Reference to Area Entity Bean</description>
                <ejb-ref-name>ejb/AreaLocalHome</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
                <local-home>faqapp.AreaLocalHome</local-home>
                <local>faqapp.AreaLocal</local>
            </ejb-local-ref>
            <ejb-local-ref>
                <description>Reference to Topic Entity Bean</description>
                <ejb-ref-name>ejb/TopicLocalHome</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
                <local-home>faqapp.TopicLocalHome</local-home>
                <local>faqapp.TopicLocal</local>
            </ejb-local-ref>
            <ejb-local-ref>
                <description>Reference to FAQ Entity Bean</description>
                <ejb-ref-name>ejb/FAQLocalHome</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
                <local-home>faqapp.FAQLocalHome</local-home>
                <local>faqapp.FAQLocal</local>
            </ejb-local-ref>
        </session>
    </enterprise-beans>
    <relationships>
        <ejb-relation>
            <ejb-relation-name>Area-Topics</ejb-relation-name>
            <ejb-relationship-role>
                <ejb-relationship-role-name>Area-has-Topics</ejb-relationship-role-name>
                <multiplicity>One</multiplicity>
                <relationship-role-source>
                    <ejb-name>Area</ejb-name>
                </relationship-role-source>
                <cmr-field>
                    <cmr-field-name>topics</cmr-field-name>
                    <cmr-field-type>java.util.Collection</cmr-field-type>
                </cmr-field>
            </ejb-relationship-role>
            <ejb-relationship-role>
                <ejb-relationship-role-name>Topics-have-Area</ejb-relationship-role-name>
                <multiplicity>Many</multiplicity>
                <relationship-role-source>
                    <ejb-name>Topic</ejb-name>
                </relationship-role-source>
                <cmr-field>
                    <cmr-field-name>area</cmr-field-name>
                </cmr-field>
            </ejb-relationship-role>
        </ejb-relation>
        <ejb-relation>
            <ejb-relation-name>Areas-FAQs</ejb-relation-name>
            <ejb-relationship-role>
                <ejb-relationship-role-name>Areas-have-FAQs</ejb-relationship-role-name>
                <multiplicity>Many</multiplicity>
                <relationship-role-source>
                    <ejb-name>Area</ejb-name>
                </relationship-role-source>
                <cmr-field>
                    <cmr-field-name>faqs</cmr-field-name>
                    <cmr-field-type>java.util.Collection</cmr-field-type>
                </cmr-field>
            </ejb-relationship-role>
            <ejb-relationship-role>
                <ejb-relationship-role-name>FAQs-have-Areas</ejb-relationship-role-name>
                <multiplicity>Many</multiplicity>
                <relationship-role-source>
                    <ejb-name>FAQ</ejb-name>
                </relationship-role-source>
                <cmr-field>
                    <cmr-field-name>areas</cmr-field-name>
                    <cmr-field-type>java.util.Collection</cmr-field-type>
                </cmr-field>
            </ejb-relationship-role>
        </ejb-relation>
        <ejb-relation>
            <ejb-relation-name>FAQs-Topics</ejb-relation-name>
            <ejb-relationship-role>
                <ejb-relationship-role-name>FAQs-have-Topics</ejb-relationship-role-name>
                <multiplicity>Many</multiplicity>
                <relationship-role-source>
                    <ejb-name>FAQ</ejb-name>
                </relationship-role-source>
                <cmr-field>
                    <cmr-field-name>topics</cmr-field-name>
                    <cmr-field-type>java.util.Collection</cmr-field-type>
                </cmr-field>
            </ejb-relationship-role>
            <ejb-relationship-role>
                <ejb-relationship-role-name>Topics-have-FAQs</ejb-relationship-role-name>
                <multiplicity>Many</multiplicity>
                <relationship-role-source>
                    <ejb-name>Topic</ejb-name>
                </relationship-role-source>
                <cmr-field>
                    <cmr-field-name>faqs</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>Area</ejb-name>
                <method-intf>Local</method-intf>
                <method-name>*</method-name>
            </method>
            <method>
                <ejb-name>Topic</ejb-name>
                <method-intf>Local</method-intf>
                <method-name>*</method-name>
            </method>
            <method>
                <ejb-name>FAQ</ejb-name>
                <method-intf>Local</method-intf>
                <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>AppSessionFacade</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>
    </assembly-descriptor>
</ejb-jar>
