Index: src/java/oracle/toplink/essentials/tools/schemaframework/DefaultTableGenerator.java
===================================================================
RCS file: /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/tools/schemaframework/DefaultTableGenerator.java,v
retrieving revision 1.9
diff -r1.9 DefaultTableGenerator.java
289a290
>         processAdditionalTablePkFields(desc);
377a379,381
>         if (!mapping.isForeignKeyRelationship())
>             return;
>         
399c403,404
<             srcFldDef.setForeignKeyFieldName(dbTrgField.getTableName() + "." + dbTrgField.getName());
---
>             srcFldDef.setForeignKeyFieldName(
>                 dbTrgField.getTable().getQualifiedName() + "." + dbTrgField.getName());
516a522
>             fieldDef.setIsPrimaryKey(true);
518a525,550
>     
>     private void processAdditionalTablePkFields(ClassDescriptor desc) {
>         DatabaseTable dbTbl = null;
>         Iterator dbTblIter = desc.getTables().iterator();
>         while (dbTblIter.hasNext()) {
>             dbTbl = (DatabaseTable) dbTblIter.next();
>             Map srcFields = (HashMap)desc.getAdditionalTablePrimaryKeyFields().get(dbTbl);
>             if (null != srcFields)
>                 addJoinColumnsFkFieldToFieldDefinition(srcFields);              
>         }              
>     }    
>    
>     private void addJoinColumnsFkFieldToFieldDefinition(final Map srcFields) {
>         DatabaseField dbSrcField = null;
>         DatabaseField dbTrgField = null;
>         
>         //add source foreign key fields into the table
>         for (Iterator srcFkFields = srcFields.keySet().iterator(); srcFkFields.hasNext();) {            
>             dbSrcField = (DatabaseField)srcFkFields.next();
>             dbTrgField = (DatabaseField)srcFields.get(dbSrcField);            
>             FieldDefinition srcFldDef = (FieldDefinition)fieldMap.get(dbSrcField);
>             FieldDefinition trgFldDef = (FieldDefinition)fieldMap.get(dbTrgField);            
>             trgFldDef.setForeignKeyFieldName(
>                 dbSrcField.getTable().getQualifiedName() + "." + dbSrcField.getName());
>         }        
>     }
Index: src/java/oracle/toplink/essentials/tools/schemaframework/TableDefinition.java
===================================================================
RCS file: /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/tools/schemaframework/TableDefinition.java,v
retrieving revision 1.4
diff -r1.4 TableDefinition.java
412c412
<         fkConstraint.setTargetTable(tempTargetField.getTableName());
---
>         fkConstraint.setTargetTable(tempTargetField.getTable().getQualifiedName());
