Interstage Application Server/Interstage Web Server J2EE ユーザーズガイド
目次 索引 前ページ次ページ

第3部 EJB編> 第16章 運用コマンドを使用してカスタマイズする方法

16.4 Enterprise Bean定義ファイルのサンプル

 Enterprise Bean定義ファイルのサンプルを以下に示します。

--------------------------------------------------------------
<?xml version="1.0" encoding="Shift_JIS"?>

<!DOCTYPE ejbdef SYSTEM 'ejbdef.dtd'>

<ejbdef>
  <ejb-jar>
    <enterprise-beans>
      <entity>
        <ejb-name>EjbCmp11</ejb-name>
        <home>com.fujitsu.interstage.j2eesamples.ejb.cmp11.EjbCmp11Home</home>
        <remote>com.fujitsu.interstage.j2eesamples.ejb.cmp11.EjbCmp11Remote</remote>
        <ejb-class>com.fujitsu.interstage.j2eesamples.ejb.cmp11.EjbCmp11</ejb-class>
        <persistence-type>Container</persistence-type>
        <prim-key-class>com.fujitsu.interstage.j2eesamples.ejb.cmp11.EjbCmp11PrimaryKey</prim-key-class>
        <reentrant>False</reentrant>
        <cmp-version>1.x</cmp-version>
      </entity>
    </enterprise-beans>
    <assembly-descriptor>
      <container-transaction>
        <method>
          <ejb-name>EjbCmp11</ejb-name>
          <method-name>*</method-name>
        </method>
        <trans-attribute>Required</trans-attribute>
      </container-transaction>
    </assembly-descriptor>
  </ejb-jar>
  <fujitsu-bean-definition>
    <base>
      <jndi-name>EjbCmp11</jndi-name>
      <tran-timeout>0</tran-timeout>
      <local-mode>False</local-mode>
    </base>
    <impl>
      <impl-home-intfrep>RMI:com.fujitsu.interstage.j2eesamples.ejb.cmp11.EjbCmp11Home:0000000000000000</impl-home-intfrep>
      <impl-remote-intfrep>RMI:com.fujitsu.interstage.j2eesamples.ejb.cmp11.EjbCmp11Remote:0000000000000000</impl-remote-intfrep>
    </impl>
    <session-eb>
      <session-timeout>0</session-timeout>
      <session-idle-timeout>1800</session-idle-timeout>
      <max-ejbobject>1024</max-ejbobject>
      <initial-stateless-instance-count>0</initial-stateless-instance-count>
    </session-eb>
    <entity-eb>
      <entity-timeout>120</entity-timeout>
      <entity-instance-type>ReadWrite</entity-instance-type>
      <entity-instance-size>100</entity-instance-size>
      <entity-instance-create-type>As Required</entity-instance-create-type>
      <entity-batch-operations>True</entity-batch-operations>
    </entity-eb>
  </fujitsu-bean-definition>
  <fujitsu-cmp-definition>
    <datasource-name>EjbCmp11</datasource-name>
    <schema-name>EJB</schema-name>
    <table-name>EMPLOYEE</table-name>
    <select-for-update>False</select-for-update>
    <field-map>
      <field-map-entry>
        <field-name>ID</field-name>
        <field-type>int</field-type>
        <dbcolumn-name>ID</dbcolumn-name>
      </field-map-entry>
      <field-map-entry>
        <field-name>NAME</field-name>
        <field-type>String</field-type>
        <dbcolumn-name>NAME</dbcolumn-name>
      </field-map-entry>
      <field-map-entry>
        <field-name>ADDRESS</field-name>
        <field-type>String</field-type>
        <dbcolumn-name>ADDRESS</dbcolumn-name>
      </field-map-entry>
      <field-map-entry>
        <field-name>TELEPHONE</field-name>
        <field-type>String</field-type>
        <dbcolumn-name>TELEPHONE</dbcolumn-name>
      </field-map-entry>
    </field-map>
    <finder-map>
      <finder-map-entry>
        <finder-key-name>findALL()</finder-key-name>
        <finder-query-string></finder-query-string>
      </finder-map-entry>
    </finder-map>
  </fujitsu-cmp-definition>
</ejbdef>
--------------------------------------------------------------

目次 索引 前ページ次ページ

Copyright 2008 FUJITSU LIMITED