Presented by developerWorks, your source for great tutorials
ibm.com/developerWorks
XDoclet and EJB technology: ejb.pk field
The
ejb.pk field
marks a CMP field as participating as part of a compound key.
You do not need this for this example. But if the
DeptBean
had a complex you would
need it.
/**
* This is a cmp field.
* And it is the primary key.
*
* @ejb:pk field
*/
public abstract Integer getId();
public abstract void setId(Integer id);
XDoclet and EJB technology: ejb.persistent field
The ejb.persistent field tag marks a getter method as being part of a CMP field
declaration. This will cause the corresponding cmp field elements to be generated in
the EJB deployment descriptor:
/**
* This is a cmp field.
* And it is the primary key.
*
* @ejb.persistent field
...
*/
public abstract Integer getId();
public abstract void setId(Integer id);
The above XDoclet tag would cause the following
to be generated.
This entity bean represents a Department of
Employees.
Enhance J2EE component reuse with XDoclets
Page 35 of 49






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