NSArray primaryKeyAttributeNames=primaryKeyAttributeNames(); if (primaryKeyAttributeNames.count()>1) { if(true) return null; else throw new RuntimeException("primaryKeyDictionary does not support compound primary keys");
Object rawPK = rawPrimaryKey(); if (rawPK != null) { if (log.isDebugEnabled()) log.debug("Got raw key: "+ rawPK); NSArray primaryKeyAttributeNames=primaryKeyAttributeNames(); _primaryKeyDictionary = new NSDictionary(rawPK instanceof NSArray ? (NSArray)rawPK : new NSArray(rawPK), primaryKeyAttributeNames); } else { if (log.isDebugEnabled()) log.debug("No raw key, trying single key"); _primaryKeyDictionary = ERXEOControlUtilities.newPrimaryKeyDictionaryForObject(this);
    public NSDictionary primaryKeyDictionary(boolean inTransaction) {        if(_primaryKeyDictionary == null) {            if (!inTransaction) {                NSArray primaryKeyAttributeNames=primaryKeyAttributeNames();                if (primaryKeyAttributeNames.count()>1) {                    if(true) // ak:testing                        return null;                    else                        throw new RuntimeException("primaryKeyDictionary does not support compound primary keys");                }                if (rawPrimaryKey() != null) {                    if (log.isDebugEnabled()) log.debug("Got raw key: "+ rawPrimaryKey());                   //FIXME: Should be getting primaryKey name from the entity of the enterprise object.                    _primaryKeyDictionary = new NSDictionary(rawPrimaryKey(), primaryKeyAttributeNames.lastObject());                } else                    if (log.isDebugEnabled()) log.debug("No raw key, trying single key");                    _primaryKeyDictionary = ERXUtilities.primaryKeyDictionaryForEntity(editingContext(), entityName());            }        }        return _primaryKeyDictionary;    }