Hello guys,

please, clarify this following for me. The problem is that each time I call
get*Value() on some CMP, duplicates are added to the collection of
aggregated values when I want to get just unique values. Here is how I do
it:
I'm using value-object with aggregate element. My CategoryHeaderValue has
among the attributes collection of DocumentHeaderValue objects.
* @ejb:value-object match="header"
*                   type="Collection"
*                   relation="external"
*
aggregate="com.imedia.cms.ejb.document.interfaces.DocumentHeaderValue"
*                   aggregate-name="DocumentHeader"
*
members="com.imedia.cms.ejb.document.interfaces.DocumentLocal"
*                   members-name="Document"

The generated getCategoryHeaderValue in CategoryCMP is:
   public com.imedia.cms.ejb.category.interfaces.CategoryHeaderValue
getCategoryHeaderValue()
   {
          if( CategoryHeaderValue == null )
          {
          CategoryHeaderValue = new
com.imedia.cms.ejb.category.interfaces.CategoryHeaderValue();
          }
      try
         {
            CategoryHeaderValue.setCategoryId( getCategoryId() );
            CategoryHeaderValue.setName( getName() );
            java.util.Iterator iDocumentHeader = getDocuments().iterator();
            while (iDocumentHeader.hasNext()){

ategoryHeaderValue.addDocumentHeader( ((com.imedia.cms.ejb.document.interfac
es.DocumentLocal)iDocumentHeader.next()).getDocumentHeaderValue() );
            }
            CategoryHeaderValue.cleanDocumentHeader();

         }
         catch (Exception e)
         {
            throw new javax.ejb.EJBException(e);
         }

          return CategoryHeaderValue;
   }

DocumentHeaders is of type Collection, that allows duplicates. So, each time
getCategoryHeaderValue() being called adds duplicates to the
documentHeaders. But I'd like to not have duplicates calling the method. How
can I achieve that? I even tried to set type="java.util.Set" but it didn't
help.

TIA,

alex



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to