SCBCD Guide
HomeSCJP | SCWCD | SCBCD | SCEA | SCSA

 

<?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>

<enterprise-beans>

<entity>

<description>Entity bean description</description>

<display-name>Display name for tools</display-name>

<small-icon>File name of a JPEG/GIF image</small-icon>

<large-icon>File name of a JPEG/GIF image</large-icon>

<ejb-name>SomeEntityBean</ejb-name>

<home>com.company.EntityBeanRemoteHome</home>

<remote>com.company.EntityBeanRemote</remote>

<local-home>com.company.EntityBeanLocalHome</local-home>

<local>com.company.EntityBeanLocal</local>

<ejb-class>com.company.EntityBeanEJB</ejb-class>

<persistence-type>Container / Bean</persistence-type>

<prim-key-class>com.company.EntityBeanPK</prim-key-class>

<reentrant>False / True</reentrant>

<cmp-version>2.x /1.x</cmp-version>

<abstract-schema-name>EntityBean</abstract-schema-name>

<cmp-field><field-name>field1</field-name></cmp-field> <!--optional-->

<cmp-field><field-name>field2</field-name></cmp-field> <!--optional-->

<primkey-field>field1</primkey-field>

<env-entry> <!--optional-->

<description>Environment entry description</description>

<env-entry-name>envEntry1</env-entry-name>

<env-entry-type>java.lang.Integer</env-entry-type>

<env-entry-value>2000</env-entry-value>

</env-entry>

<ejb-ref> <!--optional-->

<description>EJB reference description</description>

<ejb-ref-name>ejb/OtherEntityBeanHomeRemote</ejb-ref-name>

<ejb-ref-type>Entity /Session</ejb-ref-type>

<home>com.company.OtherEntityBeanRemoteHome</home>

<remote>com.company.OtherEntityBeanRemote</remote>

<ejb-link>SomeEntityOrSessionBeanName</ejb-link>

</ejb-ref>

<ejb-local-ref> <!--optional-->

<description>Local EJB reference description</description>

<ejb-ref-name>ejb/OtherLocalEntityBeanHomeRemote</ejb-ref-name>

<ejb-ref-type>Entity / Session</ejb-ref-type>

<local-home>com.company.OtherLocalEntityBeanRemoteHome</local-home>

<local>com.company.OtherLocalEntityBeanRemote</local>

<ejb-link>SomeEntityOrSessionBeanName</ejb-link>

</ejb-local-ref>

<resource-ref> <!--optional-->

<description>Some DataSource description</description>

<res-ref-name>jdbc/SomeDB</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container / Application</res-auth>

<res-sharing-scope>Shareable / Unshareable</res-sharing-scope>

</resource-ref>

<resource-env-ref> <!--optional-->

<description>Some DataSource description</description>

<resource-env-ref-name>jms/SomeQueue</resource-env-ref-name>

<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>

</resource-env-ref>

<security-role-ref> <!--optional-->

<description>Security role reference description</description>

<role-name>Manager</role-name>

<role-link>Administrator</role-link>

</security-role-ref>

<security-identity> <!--optional-->

<description>Security identity description</description>

<run-as>

<description>Run as description</description>

<role-name>Manager</role-name>

</run-as>

OR

<use-caller-identity />

</security-identity>

<query> <!--optional-->

<description>Query description</description>

<query-method>

<method-name>findSomething</method-name>

<method-params> <!--optional-->

<method-param>java.lang.String</method-param>

</method-params>

</query-method>

<result-type-mapping>Local / Remote</result-type-mapping>

<ejb-ql>SELECT OBJECT(e) FROM EntityBean e WHERE e.field1 = ?1</ejb-ql>

</query>

</entity>