From: Anjo K. <an...@us...> - 2003-04-10 19:18:53
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv10925 Modified Files: ERXEntityClassDescription.java Log Message: a) added ability to specify defaultClassName b) no longer setting defaultClassName with compound keys Index: ERXEntityClassDescription.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXEntityClassDescription.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ERXEntityClassDescription.java 17 Mar 2003 12:32:47 -0000 1.30 --- ERXEntityClassDescription.java 10 Apr 2003 19:18:47 -0000 1.31 *************** *** 326,338 **** public void prepareEntityForRegistration(EOEntity eoentity) { String className = eoentity.className(); ! String alternateClassName = System.getProperty("er.extensions.ERXEntityClassDescription." ! + eoentity.name() + ".ClassName"); if (alternateClassName != null) { ! log.info(eoentity.name() + ": setting class from: " + className + " to: " + alternateClassName); eoentity.setClassName(alternateClassName); } else if (className.equals("EOGenericRecord")) { ! className = ERXGenericRecord.class.getName(); ! eoentity.setClassName(className); ! log.debug(eoentity.name() + ": setting class from EOGenericRecord to " + className); } } --- 326,341 ---- public void prepareEntityForRegistration(EOEntity eoentity) { String className = eoentity.className(); ! String defaultClassName = ERXProperties.stringForKeyWithDefault("er.extensions.ERXEntityClassDescription.defaultClassName", ERXGenericRecord.class.getName()); ! String alternateClassName = ERXProperties.stringForKey("er.extensions.ERXEntityClassDescription." + eoentity.name() + ".ClassName"); if (alternateClassName != null) { ! log.debug(eoentity.name() + ": setting class from: " + className + " to: " + alternateClassName); eoentity.setClassName(alternateClassName); } else if (className.equals("EOGenericRecord")) { ! if(eoentity.primaryKeyAttributes().count() == 1) { ! eoentity.setClassName(defaultClassName); ! log.debug(eoentity.name() + ": setting class from EOGenericRecord to " + defaultClassName); ! } else { ! log.warn(eoentity.name() + ": not setting class from EOGenericRecord to " + defaultClassName + ", it has a compound primary key"); ! } } } *************** *** 441,445 **** } } else { ! log.error("Unable to register descriptions for class: " + class1.getName()); } } --- 444,448 ---- } } else { ! log.error("Unable to register descriptions for class: " + class1.getName(), new RuntimeException()); } } |