I just faced this 'ifDoesntHaveMethodTag' problem when modifying the value object 
code.  
What I did was have value objects with different behavior--I wanted some value objects 
with cmr fields to contain primary keys instead of other value objects--extend 
different base classes.   (All the common functions went in an interface they both 
implemented.)
Then I would bracket the differing behavior in the .xdt files with pairs of isOfType 
statements:

      <XDtType:ifIsOfType value="<XDtEjbValueObj:currentValueObjectClass/>" 
type="MyValueObject" 
          extent="hierarchy">    
        ...full behavior...     
      </XDtType:ifIsOfType>
     
      <XDtType:ifIsOfType value="<XDtEjbValueObj:currentValueObjectClass/>" 
type="MyValueObjectCMRPrimaryKeys" 
        ...read-only behavior...
      </XDtType:ifIsOfType>

Introducing multiple value object base classes into your object model might not be 
harmonious; I believe the same method would work if the VO classes implemented 
different interfaces as well.  I also suggest you put .xdt files modified like this in 
your project and have its classpath include them before the regular xdoclet jars, 
instead of building custom xdoclet jars, which is what I do.
FYI - I used the primary key cmr VOs when beans contained relationships to write-once 
beans, whose VOs I cached myself.

On Tue, 14 Sep 2004 13:29:00 +0300
Rolf Sormo <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I'm trying to make a template (by editing the original valueobject.xdt) 
> that would allow me to tag either a value-object or a field in a 
> value-object as read-only (the latter is enough since I don't mind 
> tagging all fields read-only separately).
> 
> Examples of what I mean:
> 
> Tags on class level:
> /**
>   * @ejb.value-object
>   *   match="light"
>   *   name="XxxLight"
>   *
>   * @ejb.value-object
>   *   match="full"
>   *   name="XxxFull"
>   *
>   * @ejb.value-object
>   *   match="full"
>   *   name="XxxFullReadOnly"
>   *   read-only="yes"
>   */
> 
> And on method level:
> /**
>   * @ejb.value-object match="light" read-only="yes"
>   * @ejb.value-object match="full"
>   */
> 
> Reason for this is (probably obvious) that I want them read-only in some 
> value-objects and writable in others and just leaving the setter out 
> from the entity bean would make them read-only in all value-objects (and 
> the entity itself, too).
> 
> I've tried using XDtMethod:ifDoesntHaveMethodTag but it matches _any_ of 
> the value-object tags on the method level and defeats the purpose.
> 
> Anyone have any ideas where I should go about with this? Do I need to 
> edit ValueObjectTagsHandler.java and ValueObjectSubTask.java to make it 
> support this or is there a way I could just make a custom template?
> 
> And btw. great work guys, Xdoclet is great! :)
> 
> Thanks for your help.
> 
> Rolf Sormo
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM. 
> Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user


-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to