users@jaxb.java.net

Re: xjc plugin problem

From: santa T <shaoanqing_at_gmail.com>
Date: Mon, 21 May 2007 18:10:22 +0800

Thank you very much for your detail explanation.

2007/5/21, Aleksei Valikov <valikov_at_gmx.net>:
>
> Hi.
>
> annother way:
> > setMethodblock.assign(JExpr._this().ref(idFieldVar ), var);
>
>
>
> These are two different approaches. Depends on if you:
>
> a) want to add the "id" property mapped to anything in your document;
> b) simply want to add the "id" field/getter/setter.
>
> I described the first approach. You were implementing the second one.
> The difference between these two is that in the first case the property is
> added into the XJC "model". Therefore it will be available to other plugins.
> For instance, if you additionally generate equals() or hashCode() methods,
> your property will not be considered since it's not the part of the XJC
> model. Mine will.
>
> Ok, so the wrap-up is:
>
> * If you really want a new property in the model, use a).
> * If you just need few more methods, use b).
>
> Bye.
> /lexi
>