On Tue, 2004-03-02 at 08:22, Moreno Mauri wrote:
> Thank you Andrew, 

You're welcome.

> now it's ok for what concerne DAO Method's name. 
> 
> There is only one problem (the last one :-)). 
> How can I define the parameters of my DAO method ? 
> 
> XDoclet creates a DAO method with parameters 
> of the Session Bean Method (it's a mix). 

What I usually do is define a non-interface method in the bean class
with the signature I want in the DAO, and put the @dao.call tag on
that.  Then the other (@ejb.interface-method) methods call that one,
which delegates (in the generated Session class) to the DAO.


Andrew.


> 
> Thanks again, 
> Moreno 
> 
> Andrew Stevens ha scritto: 
> > On Mon, 2004-03-01 at 12:59, Moreno Mauri wrote: 
> > > Hi all, 
> > > I'm an XDoclet newbie and I'm trying to write a Session Bean 
> > > that uses a DAO Object (with a method called: metodoDAO). 
> > > 
> > > Using XDcolet inside Session Bean's code I want to create a DAO 
> > > Interface with 
> > > the method "metodoDAO" declared. 
> > > 
> > > 
> > > *************************************** 
> > > At Class Level I put the following code 
> > > 
> > > [EMAIL PROTECTED] 
> > >  *  name = "Malf" 
> > >  *  type = "Stateless" 
> > >  *  display-name="Malf Bean" 
> > >  *  description = "..." 
> > >  *  view-type = "remote" 
> > >  *  jndi-name = "ejb/Malf" 
> > >  * 
> > >  * @ejb.transaction type = "NotSupported" 
> > >  * 
> > >  * 
> > >  * @ejb.dao class = "xmalf.server.session.dao.ProvaDAOInt" 
> > >  *         impl-class = "xmalf.server.session.dao.ProvaDAO" 
> > > 
> > > ****************************************** 
> > > 
> > > at Method Level: 
> > > 
> > > /** 
> > >   * @dao.call "metodoDAO" 
> > >   * @param from 
> > >   * @param to 
> > >   * @param prodotto 
> > >   * @ejb.interface-method view-type = "remote" 
> > >   * @exception =
> > "xmalf.server.session.eccezioni.AppXmalfException" 
> > >   * 
> > >   */ 
> > > 
> > > public void initList(int from, int to, String product) { 
> > > . 
> > > . 
> > > } 
> > > 
> > > ********************************************* 
> > > 
> > > in build.xml file: 
> > > 
> > > <dao pattern="{0}"  destDir="src" > 
> > > 
> > > ********************************************* 
> > > 
> > > The result is not what I wanted: 
> > > 
> > > public interface ProvaDAOInt 
> > > { 
> > >     public void init(); 
> > > 
> > >     public void initList(int from,int to,java.lang.String product)
> > > 
> > > } 
> > > 
> > > 
> > > The method name is the name of the Session Bean's method that uses
> > the 
> > > DAO Object 
> > > and not the name I declared in @dao.call tag. 
> > > 
> > > Am I doing something wrong ? 
> > 
> > Yes.  Try using 
> > @dao.call name="metodoDAO" 
> > instead of 
> > @dao.call "metodoDAO" 
> > 
> > Andrew. 



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to