final String fieldName = field.getFieldName();
// Let's check if the field is simple or a reference to an external class
if (fks.containsKey(fieldName)) {
// It's a foreign key
final List<RelationModel> relModelList = this.tableInfo.findRelByFK(fieldName);
final RelationModel foundRelation = this.tableInfo.findRelationModelByFK(relModelList, fieldName);
final String propertyClass = Utils.getCamelNameFirstCapital ( foundRelation.getOneTable() ) + "ObjectModel";
final String propertyName = Utils.getCamelName( foundRelation.getOneTable() );
if (!usedTableNames.contains(propertyClass)) {
usedTableNames.add(propertyClass);
final String referredProperty = Utils.getCamelNameFirstCapital(foundRelation.getRfManyTable() );
out.println(MessageFormat.format("\t\tfinal {0} {1} = model.get{2}();", propertyClass, propertyName, referredProperty));
out.println(MessageFormat.format("\t\tif ( {0} == null ) '{'", propertyName));
for (int i = 0; i < relModelList.size(); i++)