> > Well you set @orion:persistence type="java.lang.String" for the
field
> > getter. So it will pushclass java.lang.String and try to iterate
over
> > persistent fields of java.lang.String and it doesn't find anything
and
> > no <cmp-field-mapping/> is generated. You were right. What we should
do
> > is to put an if/else there:
> >
> > <XDtType:ifIsOfType value="<XDtMethod:methodTagValue
> > tagName='orion:persistence' paramName='type'/>"
> > type="javax.ejb.EJBObject" extent="concrete-type">
> >     merge as it is now
> > else ifIsNotOfType
> >     <cmp-field-mapping blabla/>
> >
> Ok, I tried this approach, but it looks like ifIsOfType only works
against
> the current class, is this by design? In
TypeTagsHandler.ifIsOfType_Impl()
> value can only be return-type, null, or class. Anything else will blow
up
> since curr_type will be null and an NPE will be thrown (btw, IMHO MUCH
of
> code needs null checks, it's way too easy to have things blow up with
> nothing more helpful than an NPE!).

Yup I'll update this tag to work with rough class name too. If you're in
hurry and feel confident about your familiarity with Xdoclet then I'll
be glad to commit the updated ifIsOfType_Impl() method. I'll work on it
late tonight (GMT +3.5).

> I guess things could get working by doing the pushClass (so I can
perform
> the type check), except that in the 'not' case, I'd want to pop the
class
> (close the pushClass?!) and act on something set within the pushClass!
The
> sequence would be something like:
> 
> pushClass->check if not EJBObject -> popClass -> get PK field and add
it
> to the dd...so..any ideas on how to accomplish this? Apologies if it's
> trivial stuff, it's my second day and I'm still getting my feet wet
(well,
> trying to at least)

pushclass pop the class in </ upon exiting from the block. Playing with
push/pop is not a good solution, my proposed solution is a bit better
(as described above):

if oftype ejbobject
{
        push
        {
                the usual code
        }
}
else
        cmp-field-mapping

Ara.


_________________________________________________________
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

Reply via email to