[ http://jira.andromda.org/browse/EJB-57?page=comments#action_15470 ] 

Leandro Hermida commented on EJB-57:
------------------------------------

Hi Vance,

I am trying to fix this small bug and just having a bit of trouble figuring out 
why the current EJB3 cart code is not working.

First, in EntityEmbeddable.vsl, the area of interest:

[code]#*    *##if ($target.many)
    private $target.getterSetterTypeName $target.name = 
$target.collectionTypeImplementation;
#*    *##else[/code]

So I then go to find out why the getterSetterTypeName is giving the wrong 
datatype.  So in EJB3AssociationEndFacadeLogicImpl.java:

[code]    public String getGetterSetterTypeName()
    {
        String getterSetterTypeName = null;
        
        if (this.isMany())
        {
            final boolean specificInterfaces =
                Boolean.valueOf(
                    
ObjectUtils.toString(this.getConfiguredProperty(SPECIFIC_COLLECTION_INTERFACES))).booleanValue();
            
            final TypeMappings mappings = this.getLanguageMappings();
            if (mappings != null)
            {
                if (this.isMap())
                {
                    getterSetterTypeName = 
mappings.getTo(UMLProfile.MAP_TYPE_NAME);
                }
                else if (specificInterfaces)
                {
                    if (this.isSet())
                    {
                        getterSetterTypeName = 
mappings.getTo(UMLProfile.SET_TYPE_NAME);
                    }
                    else if (this.isList())
                    {
                        getterSetterTypeName = 
mappings.getTo(UMLProfile.LIST_TYPE_NAME);
                    }
                    else if (this.isCollection())
                    {
                        getterSetterTypeName = 
mappings.getTo(UMLProfile.COLLECTION_TYPE_NAME);
                    }
                }
                else
                {
                    getterSetterTypeName = this.getDefaultCollectionInterface();
                }
            }
            else
            {
                getterSetterTypeName = this.getDefaultCollectionInterface();
            }
        }[/code]


What is causing getterSetterTypeName to evaluate to the default java.util.Set 
when the association end is ordered?  Is it falling through into one of the two 
else statements which assign the default java.util.Set dataype.  To me it looks 
like it should be working properly...

leandro


> UML {ordered} produces invalid code
> -----------------------------------
>
>          Key: EJB-57
>          URL: http://jira.andromda.org/browse/EJB-57
>      Project: EJB Cartridge
>         Type: Bug

>  Environment: AndroMDA 3.3-SNAPSHOT on Windows using EJB3-cartridge 
> (HEAD-checkout from 16th may 2007)
>     Reporter: Tun Schlechter
>     Assignee: Vance Karimi
>  Attachments: bugreport-ordered.zip
>
> A one to many association between 2 <<entity>> classes [Class_1 and Class_2] 
> with {ordered} tag on the many side produces the following code within 
> Class_1:
> private java.util.Set<Class_2> class_2s = new java.util.ArrayList<Class_2>();
> and thus the expected following error: 
> C:\work\bugreport-ordered\core\target\src\Class_1.java:[35,46] incompatible 
> types
> found   : java.util.ArrayList<Class_2>
> required: java.util.Set<Class_2>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.andromda.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

Reply via email to