Title: RE: [Middlegen-user] Getting Foreign Key from RelationshipRole
The problem is not in fact not whether I am using a predicate or
testing for targetMany. I will try that again but let me go
back to my original question by way of example. I will leave out the velocity
script and
Title: RE: [Middlegen-user] Getting Foreign Key from RelationshipRole
Oops! I omitted a rather important detail. I added
getManyRelationshipRoles so there is both a one and a many:
// This existed
public Collection getOneRelationshipRoles() { return
getRelationshipRoles
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
As