public void readDefaultValues() {
if(_initialDefaultValues == null) {
_initialDefaultValues = new NSMutableDictionary();
EOEntity entity = entity();
NSDictionary entityInfo = (NSDictionary)entity.userInfo().objectForKey("ERXDefaultValues");
for( Enumeration e = entity.attributes().objectEnumerator(); e.hasMoreElements();) {
EOAttribute attr = (EOAttribute)e.nextElement();
String defaultValue = null;
if(attr.userInfo() != null)
defaultValue = (String)attr.userInfo().objectForKey(defaultKey);
if(defaultValue == null && entityInfo != null) {
defaultValue = (String)entityInfo.objectForKey(attr.name());
}
if(defaultValue != null)
setDefaultAttributeValue(attr, defaultValue);
}
for( Enumeration e = entity.relationships().objectEnumerator(); e.hasMoreElements();) {
EORelationship rel = (EORelationship)e.nextElement();
String defaultValue = null;
if(rel.userInfo() != null)
defaultValue = (String)rel.userInfo().objectForKey(defaultKey);
if(defaultValue == null && entityInfo != null) {
defaultValue = (String)entityInfo.objectForKey(rel.name());
}
if(defaultValue != null)
setDefaultRelationshipValue(rel, defaultValue);
}
}