There is a bug in Torque OM generation (Java code does not compile) which appears in the following conditions :
torque.complexObjectModel=true, torque.objectIsCaching=true, torque.generateBeans=true and a table has several references to an other table.
The problem can be reproduced with the test case I added in the test-schema.xml.patch file attached (XML definition of table 'multi_referencor' which references table 'referenced' through three columns). If one adds 'multi_rerencor' and 'referenced' table definitions in file test-schema.xml and then runs the Torque test project, test fails during compilation of "base" class generated for table 'referenced' in method :
public static Referenced createReferenced(ReferencedBean bean, IdentityMap createdObjects).
Here is a patch which corrects the defect in template ObjectBeanMethods.vm