Discussion:
[Middlegen-user] Columns and RelationshipRoles
EEC - Darren Inwood
2003-01-20 19:29:08 UTC
Permalink
hi all :)

i am trying to get CMR going in the struts plugin for the insert/update
actions. can anybody see a solution to this problem? i don't really know
the ins and outs of relationshiproles yet.

to make the create() method i need to find for each foreign key, both the
foreign key Column and the Table the foreign key is referencing. should be
easy right? :P

i can either start with $ejbTable.foreignKeyColumns, or
ejbTable.oneRelationshipRoles. if i start with the columns, i can't figure
out how to get the referenced table; if i start with the relationships i can
find the referenced table but seemingly not the original column.

here is the code i am using so far:

#foreach( $role in $ejbTable.oneRelationshipRoles )
#set( $refTableName = $role.getTarget($plugin).getDestinationClassName() )
#set( $columnGetterName = ? )
#end

i am trying to end up with:
${refTableName}Util.getLocalHome().findByPrimaryKey(
${table.decapName}Form.get${columnGetterName}() )

as far as i can tell, the only place to get the appropriate form getter name
is from the column. can anyone see a way to get the Column from what i have
here? ($table, $ejbTable, $plugin, $role)

--
Darren

Loading...