-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Seam and multiple foreign keys
PostPosted: Wed Nov 29, 2006 5:57 pm 
Newbie

Joined: Wed Nov 29, 2006 5:09 pm
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 30, 2006 5:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the seam generation in hibernate tools will be removed/replaced with whatever comes out of the seamgen work in the jboss seam project (it uses hibernate tools internally now instead of the other way around)

The code the current templates generates in hibernate tools is considered to verbose and inflexible so I would definitly recommend you look at seamgen (part of seam 1.1.x relases) instead and provide feedback in that context.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.