db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Dietrick <robert.dietr...@nokia.com>
Subject referencing foreign keys in other packages
Date Thu, 29 Sep 2005 01:49:47 GMT
My Torque schema definition specifies tables with foreign keys which 
span Java packages, and I have Bean generation turned on.  By default, 
this causes Torque to generate Java code which doesn't compile due to a 
number of issues:

1. In each bean class with a foreign key constraint that spans packages, 
the generated import statements for the Bean classes in the foreign 
package are assumed to be in the local package, and therefore reference 
non-existent classes.
2. Classes with cross-package foreign keys attempt to call the methods 
create[ClassName]([BeanClassName]) and getBean(IdentityMap) (which have 
default package-level access) from a different package.

I'm getting around issue #1 by way of an ant <replace> task which fixes 
the code.

For issue #2, I've modified the template files that the generator uses 
to make the methods create${table.JavaName}(${beanClassName}) and 
getBean(IdentityMap) public.  I'm just wondering if anyone forsees a 
real security concern with this change?

Robert Dietrick

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message