if (e.key() == null || e.object() == null)
if (e.key() == null || e.object() == null || (e.object() != null && !(e.object() instanceof EOEnterpriseObject)))
    public Object validateValueForKey(Object value, String key) throws NSValidation.ValidationException {        if (validation.isDebugEnabled())            validation.debug("ValidateValueForKey on eo: " + this + " value: " + value + " key: " + key);        if (key==null) // better to raise before calling super which will crash            throw new RuntimeException("validateValueForKey called with null key on "+this);        Object result=null;        try {            result=super.validateValueForKey(value,key);            EOClassDescription cd = classDescription();            if(cd instanceof ERXEntityClassDescription) {                ((ERXEntityClassDescription)cd).validateObjectWithUserInfo(this, value, "validateForKey." + key, key);            }        } catch (ERXValidationException e) {            throw e;        } catch (NSValidation.ValidationException e) {            if (e.key() == null || e.object() == null)                e = new NSValidation.ValidationException(e.getMessage(), this, key);            if(validationException.isDebugEnabled()) {                validationException.debug("Exception: " + e.getMessage() + " raised while validating object: "                                      + this + " class: " + getClass() + " pKey: " + primaryKey(), e);            }            throw e;        } catch (RuntimeException e) {            log.error("**** During validateValueForKey "+key, e);            throw e;        }        return result;    }