I would like all my booleans to have a default value of 0 (as opposed to
null). You could certainly imagine where all times should be set to now,
or whatever. ERXEntityClassDescription does default values, but not from
prototypes.
public void readDefaultValues() {
if(_initialDefaultValues == null) {
_initialDefaultValues = new NSMutableDictionary();
EOEntity entity = entity();
NSMutableDictionary dict = new NSMutableDictionary();
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.prototype() != null) && (attr.prototype().userInfo() !=
null)) {
defaultValue = (String)attr.prototype().userInfo
().objectForKey(defaultKey);
}
***********************************************
...
You could add those lines and
Logged In: YES
user_id=6449
Dang. The lines following the ones I added need changing, too:
if(attr.userInfo() != null) {
String tempString = (String)attr.userInfo().objectForKey
(defaultKey);
if (tempString != null) {
defaultValue = tempString;
}
}