TableDecorator doesn't have a getManyRelationshipRoles() method, so it's the first 
loop you'll never enter. Try:

#foreach($role in $table.relationshipRoles)
  #if($role.targetMany)
    #foreach( $map in $role.columnMaps )
        System.out.println("${map.foreignKey}");  
    #end
  #end
#end

Aslak

-----Original Message-----
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of Rod Macpherson
Sent: 8. desember 2002 19:37
To: [EMAIL PROTECTED]
Subject: [Middlegen-user] Getting Foreign Key from RelationshipRole


I am iterating over a set of one-to-many relationship roles for a given table in my 
velocity script.  When the target is "many" the columnMaps array is always empty. How 
would I print out the foreign key columns in this case? This snippet provides no 
output because the map is always empty. Where does that information reside?

#foreach($role in $table.manyRelationshipRoles)
    #foreach( $map in $role.targetRole.columnMaps )
        System.out.println("${map.foreignKey}");  
    #end
#end

All ideas welcome!



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Reply via email to