final String identifierFieldName = formBackingTypePersistenceMetadata
.getIdentifierField().getFieldName().getSymbolName();
formCreate.setAttribute("compositePkField", identifierFieldName);
for (final FieldMetadata embeddedField : formBackingTypePersistenceMetadata
.getRooIdentifierFields()) {
final FieldMetadataBuilder fieldBuilder = new FieldMetadataBuilder(
embeddedField);
fieldBuilder
.setFieldName(new JavaSymbolName(identifierFieldName
+ "."
+ embeddedField.getFieldName().getSymbolName()));
for (int i = 0; i < fieldCopy.size(); i++) {
// Make sure form fields are not presented twice.
if (fieldCopy.get(i).getFieldName()
.equals(embeddedField.getFieldName())) {
fieldCopy.remove(i);
break;
}
}
formFields.add(fieldBuilder.build());
}
}
formFields.addAll(fieldCopy);
// If identifier manually assigned, show it in creation