GenClassRef gcr,
SpeedoField sf,
MIBuilderHelper mibh,
boolean isGCId) throws SpeedoException, PException {
String prefix = mibh.getNameDefFieldPrefix(gcr, isGCId, isGCId, sf);
Manager manager = mibh.getManager(gcr);
SpeedoClass clazzWithIdField = sf.moClass.getAncestor();
if (clazzWithIdField == null) {
clazzWithIdField = sf.moClass;
}
CompositeName cn = manager.getCompositeName(clazzWithIdField.identity.objectidClass);
NameRef nr = nd.createNameRef(cn);
List idFields = clazzWithIdField.getPKFields();
for (int i = 0; i < idFields.size(); i++) {
SpeedoField pkField = (SpeedoField) idFields.get(i);
// create a hidden field in the class corresponding to this