EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName);
EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
    public static NSArray decodeEnterpriseObjectsFromFormValues(EOEditingContext ec, NSDictionary values) {        if(log.isDebugEnabled()) log.debug("values = "+values);        NSMutableArray encoded = new NSMutableArray();        NSArray temp = (NSArray)values.objectForKey("sep");        String separator = temp != null && temp.count() > 0 ?(String)temp.lastObject() : null;        if(temp != null && temp.count() > 1)            log.warn("Found multiple separators in form values: " + temp);        if(separator == null)            separator = EntityNameSeparator;            for(Enumeration e = values.keyEnumerator(); e.hasMoreElements();) {                String key =(String)e.nextElement();                if(key.indexOf(separator) != -1) {                    boolean isEncrypted = key.indexOf(separator + "E") != -1;                    String encodedEntityName = key.substring(0, key.indexOf(separator));                    String entityName = entityNameDecode (encodedEntityName);                    // FIXME: This needs to be made case insensitive and should be getting the                    //        model group from the ec                    EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName);                    if(entity != null) {                        if(entity.primaryKeyAttributes().count() == 1) {                            for(Enumeration ee =((NSArray)values.objectForKey(key)).objectEnumerator(); ee.hasMoreElements();) {                                String value =(String)ee.nextElement();                                if(isEncrypted) {                                    value = ERXCrypto.blowfishDecode(value);                                    if(value != null)                                        value = value.trim();                                }                                if(value != null) {                                    // ENHANCEME: Could just form a fault here seeing that we have the pk.                                    EOEnterpriseObject eo =(EOEnterpriseObject)EOUtilities                                        .objectMatchingKeyAndValue(ec, entity.name(),                                        ((EOAttribute)entity.primaryKeyAttributes().lastObject()).name(), value);                                    if(eo != null)                                        encoded.addObject(eo);                                } else {                                    log.warn("Value null after blowfish decode: "                                                             + values.objectForKey(key));                                }                            }                        } else {                            log.warn("Entity: " + entity.name() + " has compound pk. Attributes: "                                                             + entity.primaryKeyAttributes());                        }                } else {                                        log.warn("Unable to find entity for name: " + entityName);                }            }        }        return encoded;    }    