ibm.com/developerWorks
Presented by developerWorks, your source for great tutorials
...
id
Notice that the
specifies the single cmp field that is used for the
primary key. If you were using a compound primary key then you would need to create
a primary key class. XDoclet can easily generate the primary key class for you.
Another important point to notice is that you never specified the class of the EJB
component directly. XDoclet, which parses the Java code, has access to the parse tree
thus it knows the package name and class name already. This also means that if you
change the name or package name, you would not have to manually update the
deployment descriptor.
XDoclet and EJB technology: ejb.home and
ejb.interface tags
XDoclet will generate the homes and interfaces for the class. You can give the
interfaces that will be generated a name using
ejb.home
and
ejb.interface
tags.
Or you can let XDoclet pick a name based on a pattern that you specified. In this
example, you specify the name of the local home and local interface in the class file.
/**...
* @ejb.home generate="local" local class="ejb.DeptHome"
* @ejb.interface generate="local" local class="ejb.Dept"
*
...
*/
public abstract class DeptBean implements EntityBean {
Notice that with the
ejb.home
and
ejb.interface
you can specify to generate the
local, remote or both. The above will cause an
ejb.DeptHome
home interface to be
generated and a local interface called
ejb.Dept
to be generated. In addition the
following elements will be defined in the
ejb jar.xml
deployment descriptor based on
the above tags.
...
DeptBean
Page 30 of 49
Enhance J2EE component reuse with XDoclets






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

j2ee web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved