gidString += attribute.name() + ": \'" +  expression.formatValueForAttribute(value, attribute) + "\'"
String stringValue = expression.formatValueForAttribute(value, attribute); if("NULL".equals(stringValue)) { stringValue = "" + value; } gidString += attribute.name() + ": \'" +  stringValue + "\'"
    public boolean databaseContextFailedToFetchObject(EODatabaseContext context, Object object, EOGlobalID gid) {        if (object!=null) {            EOEditingContext ec = ((EOEnterpriseObject)object).editingContext();            // we need to refault the object before raising, otherwise, if the caller traps            // the exception, it will be a successful lookup the next time a fault with the            // same global id fires.  NOTE: refaulting in a sharedEditingContext is illegal,            // so we specifically check for that special case.            if (!(ec instanceof EOSharedEditingContext)) {                context.refaultObject((EOEnterpriseObject)object, gid, ec);            }        }        String gidString;        if(gid instanceof EOKeyGlobalID) {            // ak: when you use 24 byte PKs, the output is unreadable otherwise             EOKeyGlobalID kgid = (EOKeyGlobalID)gid;            gidString = "<" +  kgid.entityName() + ": [" ;            EOEntity entity = ERXEOAccessUtilities.entityNamed(null, kgid.entityName());            NSArray pks = entity.primaryKeyAttributes();            NSArray values = kgid.keyValuesArray();            EOSQLExpression expression = context.database().adaptor().expressionFactory().expressionForEntity(entity);            for(int i = 0; i < pks.count(); i++) {                Object value = values.objectAtIndex(i);                EOAttribute attribute = (EOAttribute) pks.objectAtIndex(i);                gidString += attribute.name() + ": \'" +  expression.formatValueForAttribute(value, attribute) + "\'"                + (i == pks.count() - 1 ? "" : ", ");            }            gidString += "] >";                    } else {            gidString = gid.toString();        }        throw new EOObjectNotAvailableException("No " + (object!=null ? object.getClass().getName() : "N/A") + " found with globalID: " + gidString);                }