Hi,
This points something I have solved using a custom merge point in
session bean.
I have tags like ejb:facade-add ejb:facade-find ejb:facade-modify
ejb:facade-remove ejb:facade-list
That generates the session bean facade code to entity bean using a Data
Object and a setter/getter method of ths Data class type.
But I am still not sure how "standard" this is.
Something like:
<XDtMethod:forAllMethods>
<XDtMethod:ifHasMethodTag tagName="hm:facade-find">
<XDtMethod:forAllMethodTags tagName="hm:facade-find">
public <XDtMethod:methodType/>
<XDtMethod:methodName/>(<XDtParameter:parameterList/>)
throws javax.ejb.FinderException<XDtMethod:exceptionList
skip="javax.ejb.FinderException"/>{
if (pk==null) throw new javax.ejb.FinderException("PK provided
was Blank");
if (cat.isDebugEnabled())
cat.debug("<XDtMethod:methodName/>("+pk+")");
<XDtMethod:ifDoesntHaveMethodTag tagName="hm:facade-find"
paramName="local">
try{
</XDtMethod:ifDoesntHaveMethodTag>
<XDtMethod:ifDoesntHaveMethodTag tagName="hm:facade-find"
paramName="local">
<XDtMethod:methodType/> detail =
home<XDtMethod:methodTagValue tagName="hm:facade-find" paramName="name"
paramNum="0"/>DOHome().findByPrimaryKey(pk).getDetails();
</XDtMethod:ifDoesntHaveMethodTag>
<XDtMethod:ifHasMethodTag tagName="hm:facade-find"
paramName="local">
<XDtMethod:methodType/> detail =
home<XDtMethod:methodTagValue tagName="hm:facade-find" paramName="name"
paramNum="0"/>DOLocalHome().findByPrimaryKey(pk).getDetails();
</XDtMethod:ifHasMethodTag>
return detail;
<XDtMethod:ifDoesntHaveMethodTag tagName="hm:facade-find"
paramName="local">
} catch (java.rmi.RemoteException e) {
cat.error("Remote Exception",e);
throw new javax.ejb.EJBException(e);
}
</XDtMethod:ifDoesntHaveMethodTag>
}
</XDtMethod:forAllMethodTags>
</XDtMethod:ifHasMethodTag>
</XDtMethod:forAllMethods>
As you will see it is not ready for inclusion into xdoclet because it
still contains some hypotheses that work for me only.
It is on my list to rework them to be more general and possibly include
them in xdoclet.
My only question is how standard is this and does the bosses want that
included or left as option or ...
BTW Try to do that with other ejb generation tools, he he he
Regards
Vincent
> I'm surprised that more people don't want to do this tho'.
> I've sent a Collection of *Data object over to a client, the
> client is updating them and sending them back to the server
> to be updated. It seems that it would be common to want to do
> something like...
>
>
> public void updateCustomer(CustomerData custData) {
>
> try {
> Customer cust = custHome.findByPrimaryKey(
> CustomerUtil.getPkFrom(custData));
> cust.setData(custData);
> } catch ( ... ) {
> // handle problems ;-)
> }
> }
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel