Hi,

You can your own tag @chris:finder-criteria or something
And use the XDoclet command to setup anything in the -custom.j files that
are merged automatically.
Please report missing -custom.j.

> I would like to generate a finder method (e.g. findByCrtieria) in my home
> interface with all the defined attributes (e.g. all
> @ejb:persistent-field),
> anyway that I can automate this (cuz this is one of our standard finder
> method in all the entity bean)?

Use the home-custom.j.

>
> P.S.
> We use Session Controller (Session Bean) to wrap the Entity Bean, any way
> that I can generate this (and this one is quite simple) during the bean
> generation?  (i.e. does ejbdoclet allow to generate additional
> self-defined
> file(s)?)

Use the session-custom.j to set up this.
I have done that.

Here is an example:
   <XDoclet:forAllMethods>
   <XDoclet:ifHasMethodTag tagName="hm:facade-find">
   <XDoclet:forAllMethodTags tagName="hm:facade-find">
   public <XDoclet:methodType/>
<XDoclet:methodName/>(<XDoclet:parameterList/>)
   throws javax.ejb.FinderException<XDoclet:exceptionList
skip="javax.ejb.FinderException"/>{
        if (pk==null) throw new javax.ejb.FinderException("PK provided was
Blank");
        if (cat.isDebugEnabled())
cat.debug("<XDoclet:methodName/>("+pk+")");
        <XDoclet:ifDoesntHaveMethodTag tagName="hm:facade-find"
paramName="local">
        try{
        </XDoclet:ifDoesntHaveMethodTag>
            <XDoclet:ifDoesntHaveMethodTag tagName="hm:facade-find"
paramName="local">
            <XDoclet:methodType/> detail = home<XDoclet:methodTagValue
tagName="hm:facade-find" paramName="name"
paramNum="0"/>DOHome().findByPrimaryKey(pk).getDetails();
            </XDoclet:ifDoesntHaveMethodTag>
            <XDoclet:ifHasMethodTag tagName="hm:facade-find"
paramName="local">
            <XDoclet:methodType/> detail = home<XDoclet:methodTagValue
tagName="hm:facade-find" paramName="name"
paramNum="0"/>DOLocalHome().findByPrimaryKey(pk).getDetails();
            </XDoclet:ifHasMethodTag>
            return detail;
        <XDoclet:ifDoesntHaveMethodTag tagName="hm:facade-find"
paramName="local">
        } catch (java.rmi.RemoteException e) {
            cat.error("Remote Exception",e);
            throw new javax.ejb.EJBException(e);
        }
        </XDoclet:ifDoesntHaveMethodTag>
   }
   </XDoclet:forAllMethodTags>
   </XDoclet:ifHasMethodTag>
   </XDoclet:forAllMethods>

>
> Thanks in advance!
>
> Chris
>

Vincent.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to