Entities not inheriting/extending parent DAO when enableTemplating is true

Description

Taken from: http://forum.andromda.org/viewtopic.php?f=9&t=6851

I have an Entity class Foo that has a parent entity Bar. Bar has a dependency on BarVO and Foo has a dependency on FooVO. When I generate code for Foo, I expected the Entity to have 2 conversion methods: toFooVO and toBarVO, but it has only one (toFooVO). I noticed when I set enableTemplating to false to test a separate issue: http://forum.andromda.org/viewtopic.php?f=9&t=6850 that the Entity inherits the dependency properly and writes the necessary code for conversion (toBarVO)

(continued)

I have my test project built and can reproduce the error there as well. I have 4 classes, a FooParent, FooChild, FooParentVO, and FooChildVO. The FooChild extends FooParent, FooChild depends on FooChildVO, and FooParent depends on FooParentVO. The expectation is that FooChild will have cases in transformEntity for both FooChildVO and FooParentVO. If I have enableTemplating set to false, generation works as expected. If I have enableTemplating set to true, I do not inherit a transform for ParentVO. I also notice that all other template declarations depending on the 'daoInheritanceEnabled' property will be missing in the ChildDaoBase as well, including the class definition of extending the ParentDao (ChildDao extends ParentDao)

Environment

java 1.6, maven 2.2, magicdraw 16.8, emf2.2 model

Activity

Show:
Walter Mourão
August 28, 2010, 7:56 PM

I took a look at the code and it seems it is working as designed. enableTemplating excludes daoInheritanceEnabled and the transformations does not occur.

Mike Dikan
August 29, 2010, 9:57 AM

I guess i'm a little confused then. Why is the behavior designed to disable daoInheritance when templating is enabled?

Walter Mourão
August 29, 2010, 6:05 PM

I don't know... Take a look at http://docs.andromda.org/andromda-cartridges/andromda-spring-cartridge/namespace.html#daoInheritanceEnabled

I suggest you open another forum entry asking specifically about that.

Assignee

Former user

Reporter

Mike Dikan

Labels

None

Time tracking

4h

Affects versions

Priority

Major
Configure