[
https://issues.apache.org/jira/browse/TUSCANY-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470617
]
Frank Budinsky commented on TUSCANY-1095:
-----------------------------------------
This is a bug in the new generator template (SDOClass.javajet). Since we
regenerated sdoModel.xsd with the new noEMF pattern, it now uses
containment-type lists (EObjectContainmentEList) for all List-type properties.
The "baseType" property should be using EObjectEList (actually probably
EObjectResolvingEList - whatever it used to be with the old EMF-style
template). Because it's erroneously generating a containment list, it's having
the side effect described above.
List property generation seems to be completely broken in general. The template
isn't handling bi-directional (e.g., EObjectWithInverseEList), proxy resolving,
unsettable, etc. Every flavor of list other than basic containment is broken
with the new template.
This part of the template should not always be calling createPropertyList with
the containment list kind:
<%=genFeature.getSafeName()%> =
createPropertyList(ListKind.CONTAINMENT,
<%=genFeature.getListItemType()%>.class, ...
It needs to pass a "correct" kind indicator, which createPropertyList() would
use to create the correct kind of EMF List. It used to just new up the right
kind of EList, but createPropertyList() was added as the indirect way to do it
without having an EMF dependency in the generated code. The new noEMF template
should have all the same logic as before, but just using
"createPropertyList(<some kind>, ...)" instead of "new E<some kind>List(...)".
Note that the implementation of createPropertyList() in class FactoryBase, also
needs to be completed.
> "baseType" properties on DataObjects are using the wrong base EMF list class
> ----------------------------------------------------------------------------
>
> Key: TUSCANY-1095
> URL: https://issues.apache.org/jira/browse/TUSCANY-1095
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SCA-M3, Java-SCA-Mx, Java-SDO-Mx
> Environment: n/a
> Reporter: David T. Adcox
> Fix For: Java-SDO-Mx
>
>
> There is a problem when setting the "baseType" property on a DataObject.
> Specifically, if a new Type is being dynamically created, when a parent type
> is specified in the "baseType" property, upon setting that property, the
> parent type is taken out of the ePackage to which it belongs. It seems the
> list type being used checks for containment. That should not be a
> consideration in this case. I'll attach a sample of code demonstrate this
> behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]