entity=EOModelGroup.defaultGroup().entityNamed(entityName);
entity=ERXEOAccessUtilities.entityNamed(object.editingContext(), entityName);
    public static String userInfoUnit(EOEnterpriseObject object, String key) {        // return the unit stored in the userInfo dictionary of the appropriate EOAttribute        EOEntity entity=null;        String lastKey=null;        String result=null;        if (key.indexOf(".")==-1) {            String entityName=object.entityName();            entity=EOModelGroup.defaultGroup().entityNamed(entityName);            lastKey=key;        } else {            String partialKeyPath=ERXStringUtilities.keyPathWithoutLastProperty(key);            EOEnterpriseObject objectForPropertyDisplayed=(EOEnterpriseObject)object.valueForKeyPath(partialKeyPath);            if (objectForPropertyDisplayed!=null) {                entity=EOModelGroup.defaultGroup().entityNamed(objectForPropertyDisplayed.entityName());                lastKey=ERXStringUtilities.lastPropertyKeyInKeyPath(key);            }        }        if (entity!=null && lastKey!=null) {            EOAttribute a=entity.attributeNamed(lastKey);            NSDictionary userInfo=null;            if (a!=null) userInfo=a.userInfo();            else {                EORelationship r=entity.relationshipNamed(lastKey);                if (r!=null) userInfo=r.userInfo();            }            result= (String)(userInfo!=null ? userInfo.valueForKey("unit") : null);        }        return result;    }