哪位大虾讲讲session bean是怎么和实体bean结合起来存数据库的,流程怎么样的?
谢谢!

解决方案 »

  1.   

    谢谢!!!一般是在session bean哪里调用entity bean的呢?
    entitybean的Bean类里的ejbcreate()方法实现CMP的存数据库,那session bean的Bean类里的
    ejbcreate()方法用作实现什么?
      

  2.   

    我看一个例子,CMP实现存数据库部分我看清楚了,但不知客户端怎么通过session bean和CMP联系起来的,没找着;一般是在session bean哪里调用entity bean的呢???^_^
      

  3.   

    CMP部分的商务bean类我也找到了,也找到了里面的ejbcreate()方法,还有home接口的create()方法;但不知客户端是怎么通过session bean和这里实体bean的相关接口和商务bean类的create()方法联系起来的?
      

  4.   

    <!-- Session Beans -->
          <session >
             <description><![CDATA[Project Session Bean is an stateful session bean that provides the interface for process definition.]]></description>
             <display-name>ProjectSession Bean</display-name>         <ejb-name>ProjectSession</ejb-name>         <home>hero.interfaces.ProjectSessionHome</home>
             <remote>hero.interfaces.ProjectSession</remote>
             <local-home>hero.interfaces.ProjectSessionLocalHome</local-home>
             <local>hero.interfaces.ProjectSessionLocal</local>
             <ejb-class>hero.session.ProjectSessionSession</ejb-class>
             <session-type>Stateful</session-type>
             <transaction-type>Container</transaction-type>         <ejb-ref >
                <ejb-ref-name>ProjectSession</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <home>hero.interfaces.ProjectSessionHome</home>
                <remote>hero.interfaces.ProjectSession</remote>
                <ejb-link>ProjectSession</ejb-link>
             </ejb-ref>
             <ejb-ref >
                <ejb-ref-name>myhero/BnProject</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
                <home>hero.interfaces.BnProjectHome</home>
                <remote>hero.interfaces.BnProject</remote>
                <ejb-link>BnProject</ejb-link>
             </ejb-ref>      </session>
    ------------------------
    请问上面的后半部分的两个<ejb-ref>和</ejb-ref>之间的内容什么用的?什么时候用到?