All of the EJB samples XDoclet provides are for EJB 2.0. Is it possible to write EJB 1.1 applications using XDoclet?
Created Jan 28, 2002
Ara Abrahamian
It's also worth to mention that XDoclet generates deployment descriptors
which are spec version compliant (DTD points to correct version, elements and
attributes have version specific details in mind, and so on).
Definitely. Set ejbSpec="1.1" in <ejbdoclet/> but follow the rules of EJB 2.0 in source code. This means instead of defining persistent fields as normal attributes (the way EJB 1.1 is), follow the abstract schema rules of EJB 2.0 like this:
/** * @ejb:persistent-field */ public abstract String getName(); public abstract void setName(String name);
And remember you should define your CMP bean abstract and activate the <entitycmp/> sub-task of <ejbdoclet/>. <entitycmp/> generates a sub-class which is understandable by a EJB 1.1 container.