cmp-ejb-jar.xml

<?xml version="1.0"?>

 

<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">

 

<ejb-jar>

 <enterprise-beans>

  <entity>

   <ejb-name>Product</ejb-name>

   <home>examples.ProductHome</home>

   <remote>examples.Product</remote>

   <ejb-class>examples.ProductBean</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>ProductBean</abstract-schema-name>

  

   <cmp-field>

    <field-name>productID</field-name>

   </cmp-field>

   <cmp-field>

    <field-name>name</field-name>

   </cmp-field>

   <cmp-field>

    <field-name>description</field-name>

   </cmp-field>

   <cmp-field>

    <field-name>basePrice</field-name>

   </cmp-field>

  

   <primkey-field>productID</primkey-field>

  

   <query>

    <query-method>

     <method-name>findByName</method-name>

     <method-params>

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

     </method-params>

    </query-method>

    <ejb-ql>

     <![CDATA[WHERE name = ?1]]>

    </ejb-ql>

   </query>

 

   <query>

    <query-method>

     <method-name>findByDescription</method-name>

     <method-params>

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

     </method-params>

    </query-method>

    <ejb-ql>

     <![CDATA[WHERE description = ?1]]>

    </ejb-ql>

   </query>

 

   <query>

    <query-method>

     <method-name>findByBasePrice</method-name>

     <method-params>

      <method-param>double</method-param>

     </method-params>

    </query-method>

    <ejb-ql>

     <![CDATA[WHERE basePrice = ?1]]>

    </ejb-ql>

   </query>

 

   <query>

    <query-method>

     <method-name>findExpensiveProducts</method-name>

     <method-params>

      <method-param>double</method-param>

     </method-params>

    </query-method>

    <ejb-ql>

     <![CDATA[WHERE basePrice > ?1]]>

    </ejb-ql>

   </query>

 

   <query>

    <query-method>

     <method-name>findCheapProducts</method-name>

     <method-params>

      <method-param>double</method-param>

     </method-params>

    </query-method>

    <ejb-ql>

     <![CDATA[WHERE basePrice < ?1]]>

    </ejb-ql>

   </query>

 

   <query>

    <query-method>

     <method-name>findAllProducts</method-name>

     <method-params>

     </method-params>

    </query-method>

    <ejb-ql>

     <![CDATA[WHERE productID IS NOT NULL]]>

    </ejb-ql>

   </query>

 

  </entity>

 </enterprise-beans>

   

 <assembly-descriptor>

  <container-transaction>

   <method>

    <ejb-name>Product</ejb-name>

    <method-intf>Remote</method-intf>

    <method-name>*</method-name>

   </method>

   <trans-attribute>Required</trans-attribute>

  </container-transaction>

 </assembly-descriptor>

 

</ejb-jar>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值