Message:

   The following issue has been re-assigned.

   Assignee: Matthias Germann (mailto:[EMAIL PROTECTED])
---------------------------------------------------------------------
View the issue:
  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-903

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XDT-903
    Summary: CMR collection in valueobjects generating wrong code + docs
       Type: Bug

     Status: Open
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: XDoclet
 Components: 
             EJB Module
   Versions:
             1.2.1

   Assignee: Matthias Germann
   Reporter: Thomas Lund

    Created: Sun, 16 May 2004 5:34 AM
    Updated: Sun, 3 Apr 2005 3:02 AM
Environment: Win xp, xdoclet 1.2.1

Description:
I'm trying to make xdoclet generate a Collection of value objects for a CMR 
relation in my bean and it fails to compile.

Additionally the documentation is not up to date.

Documentation first:
In http://xdoclet.sourceforge.net/xdoclet/tags/ejb-tags.html for the method 
level value objects it says:

"
On a multi-valued property, indicates the type of the collection returned by 
the EJB property accessor. This should be set to 'java.util.Collection' or 
'java.util.Set' in all multi-valued properties.
Valid options are:
java.util.Collection
java.util.Set
"

This is not in correspondance with the value object documentation found here:
http://xdoclet.sourceforge.net/xdoclet/valueobjects.html

Where it says Collection or Set


The problem is that if I put in "java.util.Collection", xdoclet generates code 
that returns ValueObject[] and not a collection. When I insert "Collection" 
then it doesnt compile with a "cannot resolve symbol
symbol  : class Collection "


My xdoclet code for the CMR is
        /**
         * @ejb.interface-method
         * @ejb.relation
         *      name="user-credit"
         *      role-name="user"
         *
         * @ejb.value-object
         *      
aggregate="com.codejar.spilland.backend.entity.model.CreditValue"
         *      aggregate-name="CreditValue"
         *      
members="com.codejar.spilland.backend.entity.interfaces.CreditLocal"
         *      members-name="CreditValue"
         *      relation="external"
         *      type="java.util.Collection"
         *      match="full"
         */
        public abstract Collection getCredits();


This generates this code:

   public com.codejar.spilland.backend.entity.model.CreditValue[] 
getCreditValues()
   {
          return 
(com.codejar.spilland.backend.entity.model.CreditValue[])this.CreditValues.toArray(new
 com.codejar.spilland.backend.entity.model.CreditValue[CreditValues.size()]);
   }


Writing
        public abstract java.util.Collection getCredits();

does not change the generated code a bit. Its still using creditValue[]


Now trying to follow the other documentation and just writing type="Collection" 
still gives me a CreditValue[], but in addition the rest of the code is 
uncompilable, as the generated code is a missing import java.util.Collection, 
and Collection is used all over the place.




---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to