A wise old hermit known only as Jon Finanger <[EMAIL PROTECTED]> once said:

> I'm using xdoclet 1.2.0 beta1 with jboss3.0.4, BMP and DAO 
> 
> Scenario:
> xdoclet does not generate the create( ) methods correctly.

That depends on what you consider correct.  As far as I know it works just 
fine as designed, but you may disagree with my design ;-)

> I tag my create method with @ejb.create-method and the result in MyBMP 
> is:
>    public MyPK ejbCreate(MyData data) throws javax.ejb.CreateException
>    {
>       return getDao().create((MyBean) this);
>    }
> It passes this to the dao implementation without loading the bean with 
> the Data before the dao impl is called.

Do you have anything in the ejbCreate method in your bean class?

The basic idea is you call the relevant setter methods to set up the bean 
state using the parameters in the ejbCreate method in your bean class, and 
the BMP subclass calls out to the DAO afterwards (well actually it 
overrides the method and calls super.ejbCreate(...), but it's the same 
thing).  Compare this to CMP, where your ejbCreate(...) calls the relevant 
setter methods to set up the bean state using the parameters and then the 
CMP engine generated subclass handles persists it to the database 
afterwards...

I figure doing it this way makes it less effort to switch between BMP+DAO 
and CMP in the future, since the ejbCreate's code stays the same (which is 
also the reason the finder methods are added to the DAO automatically in 
1.2 beta 1, by the way).

Of course, if you're doing this already and the super call isn't being 
added in the BMP subclass, then that's a bug and you should raise an issue 
for it in JIRA.


Andrew.


-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to