We are upgrading a legacy RPG AS/400 app using JBoss and Seam. We need to generate hundreds of simple data entry screens and the Seam generator is a perfect solution. I have run into two issues that are keeping me from proceeding and was hoping for some advice.
1) Composite keys
2) Multiple foreign keys from the same table
This posting is in regards to the #2
BTW - Redesigning the database is not an option at this time.
example:
Customer has two columns - Account and MasterAccount. Both Account and MasterAccount reference the same table - "Account".
When the template editor.java.ftl is processed, it correctly creates two properties using ${property.name}, in this case "account" and "masterAccount"
However, it then creates a "select" method that uses the value ${parentPojo.shortName}. This seems to get resolved to the class name of the reference which is "Account" in both cases, so the total resulting code is:
Code:
Account account;
Account masterAccount;
public Account selectAccount();
public Account selectAccount(): // instead of selectMasterAccount();
This creates two methods with the same name which is a problem. Simply changing ${parentPojo.shortName} to ${property.name} fixes this but breaks a bunch of other code.
I would like to fix this but I need a better understanding of what the parentPojo is and why it is used in the various templates.
I am using JBoss IDE nightly build Nov 21st 2006
Best regards