Dao inheritance: Subclasses cannot access ancestor navigable associations

Description

daoInheritanceEnabled i think that this is not respected even I set this explicitly to true.

I described my problem here http://forum.andromda.org/viewtopic.php?f=2&t=6688&p=28510#p28510

The problem is that I can't have access in subclasses that extend a superclass to dao's from superclass.

Thanks.

I attached my andromda.xml file below.

Environment

Mac OS

Activity

Show:
Vladimir Zavati
April 1, 2010, 1:43 AM

No excuse me it's just a late hour and I'm tired. If that is false those set are not made, I said a wrong thing.

Vladimir Zavati
April 1, 2010, 2:04 AM

I changed this:

#if ($entity.generalization)
#set ($superclass = $entity.generalization)
#set ($daoInheritance = $superclass && $daoInheritanceEnabled)
#if ($daoInheritance)
#set ($rootEntityType = $entity.root.fullyQualifiedEntityName)
#else
#set ($rootEntityType = $entity.fullyQualifiedEntityName)
#end
#else
#set ($daoInheritance = false)
#set ($rootEntityType = $entity.fullyQualifiedEntityName)
#end

TO this


#set ($superclass = $entity.generalization)
#set ($daoInheritance = $superclass && $daoInheritanceEnabled)
#if ($daoInheritance)
#set ($rootEntityType = $entity.root.fullyQualifiedEntityName)
#else
#set ($rootEntityType = $entity.fullyQualifiedEntityName)
#end

and with <property name="daoInheritanceEnabled">true</property> the same result: "extends HibernateDaoSupport" my subclass does not extend my superclass daobase.

Maybe in other files I must make some changes, I hope somebody will look here also on this problem and help a little.

I wish you all a good day !

Former user
April 1, 2010, 3:50 AM

Hmhhh...

There is a condition in cartridge.xml
<condition name="daoInheritanceEnabled">
#if ($daoInheritanceEnabled.equalsIgnoreCase("true") &amp;&amp; !$enableTemplating.equalsIgnoreCase("true"))true#end
</condition>
This condition rewrite the daoInheritanceEnabled property and set it to false if enableTemplating is true.

You have to set this property to false, to get daoInheritanceEnabled working:
<property name="enableTemplating">false</property>
<property name="daoInheritanceEnabled">true</property>

I'm not sure, why we have this condition. I think there are issues with generic return types if both properties are enabled. I will check this later.

Vladimir Zavati
April 1, 2010, 2:05 PM

Hello Plushnikov,

Thank you for your post. I don't have access to my code now to test, but I will test it soon to see if it's that. It can be. EnableTemplating I think that is to support generics.

Vladimir Zavati
April 3, 2010, 7:28 PM

I tested and is the same thing. No good results.

Assignee

Former user

Reporter

Vladimir Zavati

Labels

None

Components

Affects versions

Priority

Major
Configure