Thanks, barbee. That clarifies ;) Could you point to the patch, please?
Does your patch just creates value only if it's null? I mean
if( xxValue == null )
{
try
{
...
}
catch( Exception e )
{
throw new EJBException( e );
}
}
return xxValues;
thanks again!
alex
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: Wednesday, July 17, 2002 6:50 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Xdoclet-user] value-object aggregate
>
>
> if you're using xdoclet from cvs, then this is a bug that has
> already been
> filed.
>
> http://sourceforge.net/tracker/index.php?func=detail&aid=58254
> 9&group_id=31602&atid=402704
>
> a patch has been submitted to fix it.
>
> barbee.
>
> On Wed, Jul 17, 2002 at 01:07:10PM +0300, Alex Loubyansky wrote:
> + 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
-------------------------------------------------------
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