Appendix D. jonas-ejb-jar.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE jonas-ejb-jar PUBLIC "-//ObjectWeb//DTD JOnAS 2.4//EN"
                           "http://www.objectweb.org/jonas/dtds/jonas-ejb-jar_2_4.dtd">
<jonas-ejb-jar>
    <jonas-session>
        <ejb-name>SB_BrowseRegions</ejb-name>
        <jndi-name>SB_BrowseRegionsHome</jndi-name>
        <jonas-resource>
            <res-ref-name>jdbc/rubis</res-ref-name>
            <jndi-name>rubis</jndi-name>
        </jonas-resource>
    </jonas-session>

    <jonas-entity>
        <ejb-name>Region</ejb-name>
        <jndi-name>RegionHome</jndi-name>
        <jonas-resource>
            <res-ref-name>jdbc/rubis</res-ref-name>
            <jndi-name>mysql</jndi-name>
        </jonas-resource>

        <jdbc-mapping>
            <jndi-name>mysql</jndi-name>
            <jdbc-table-name>regions</jdbc-table-name>
            <cmp-field-jdbc-mapping>
                <field-name>id</field-name>
                <jdbc-field-name>id</jdbc-field-name>
            </cmp-field-jdbc-mapping>
            <cmp-field-jdbc-mapping>
                <field-name>name</field-name>
                <jdbc-field-name>name</jdbc-field-name>
            </cmp-field-jdbc-mapping>

            <finder-method-jdbc-mapping>
                <jonas-method>
                    <method-name>findByPrimaryKey</method-name>
                </jonas-method>
                <jdbc-where-clause>where id=?</jdbc-where-clause>
            </finder-method-jdbc-mapping>

            <finder-method-jdbc-mapping>
                <jonas-method>
                    <method-name>findByName</method-name>
                </jonas-method>
                <jdbc-where-clause>where name=?</jdbc-where-clause>
            </finder-method-jdbc-mapping>

            <finder-method-jdbc-mapping>
                <jonas-method>
                    <method-name>findAll</method-name>
                </jonas-method>
                <jdbc-where-clause></jdbc-where-clause>
            </finder-method-jdbc-mapping>
        </jdbc-mapping>

    </jonas-entity>
</jonas-ejb-jar>