http://www.tusc.com.au/tutorial/html/chap1.html
1。 stateless sessionBean(chap3)
a。例子中的ejbGenerate。xml对应于实际的xdoclet。xml 。 这是lomboz用于生成生成需要的接口或助手类的文件,需要在jboss的对应位置做对应的修改,比如:
version="3.0"
unauthenticatedPrincipal="nobody"
xmlencoding="UTF-8"
destdir="${ejb.dd.dir}"
validatexml="false"
datasource="java:/EJBTEST"
datasourcemapping="Hypersonic SQL"
preferredrelationmapping="forgein-key"
/>
b。在sessionbean(例子中的StoreAccessBean)中的注释:
@ejb.dao class="au.com.tusc.session.StoreAccessDAO"
impl-class="au.com.tusc.dao.StoreAccessDAOImpl"
生成:1。接口StoreAccessDAO 2。实现类StoreAccessDAOImpl
原有的注释:
@ejb.bean name ="StoreAccess"
jndi-name="StoreAccessBean"
type="Stateless"
生成ejb-jar。xml中的有关接口的定义和jboss。xml中的有关jndi的定义
具体的userlogin和init的实现在StoreAccessDAOImpl中完成(?层 ,bussiness method?)
-
@ejb.bean tag provides information about the EJB. It is the one compulsory tag for all EJBs.
-
@ejb.persistence tag is being used at two levels, at class level and method level. At class level it provides information about the persistence of a CMP entity bean, that is which database table this bean is going to interact with, which will provide that persistence. At method level it provides information about the mapping of the bean's persistent attributes to columns in that database table.
-
@ejb.finder tag defines a finder method for the home interface. This requires the EJB QL query to fetch the data and a signature for the method. This tag can be used for multiple finder methods.
-
@ejb.persistence-field method level tag is being deprecated in favour of @ejb.persistence tag, it provided information about persistent fields.
-
@ejb.pk-field tag defines the primary key.