I have decided to generate facades for my EntityBeans. So far, I have had
some success but the complete package yet. I have done some research into
past questions regarding facades and that has help to some degree. I have
not found an example of how to implement facades, which would be very
helpful -- largely because I can not guess the types of values that are
appropriate for many of the tag attributes.
So, here are the problems I am wrestling with:
The generated classes seem to be defaulting to using data objects when I
would prefer to use value objects. The resulting code does not compile
because I have not generated the referenced data objects. In addition to
this, the generated code is not using my intended package structure.
Here is an example of the type of genreated code that is causing me problems
(note I have truncated the full package names and replaced with {*} for
simplicity):
private {*}.ejb.CatalogLocalHome getLocalHome() throws
javax.naming.NamingException
{
return {*}.ejb.CatalogUtil.getLocalHome();
}
// finder methods
/**
* @ejb.interface-method
* @ejb.facade-method
*
*/
public {*}.ejb.CatalogData findByPrimaryKey({*}.ejb.CourseCatalogPK pk)
throws javax.ejb.FinderException, javax.naming.NamingException
{
{*}.ejb.CatalogLocal selected = getLocalHome().findByPrimaryKey(
pk );
{*}.ejb.CatalogData retval = selected.getData();
return retval;
}
Note, that all of the packages end with .ejb. However, using package
substitution, I am generating my remote and local interfaces in a package
ending with .interfaces and my util classes in a package ending in .util.
This of course means the generated code will not compile. My question here
is how do I indicate to the entityfacade task that I want it to generate
code using my prefered packages? Additionally, note that the
findByPrimaryKey method is returning an object of type CatalogData, which
does not exist. Instead, I would like it to return an object of type
CatalogValue, which is the value object for this entity. How do I specify
this to the entityfacade task?
By the way, I am very pleased with xDoclet in general and have found good
examples for most everything else that I have wanted to implement.
Your help is greatly appreciated,
Joel Rives
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user