ObjectType associated = (associatedObject == null) ? null: associatedObject.getObjectType();  for (Iterator it = type.getKeyProperties(); it.hasNext(); ) { Property prop = (Property) it.next(); if (prop.isAttribute()) { continue; }  DataType propType = prop.getType(); if (propType.equals(associated)) { data.set(prop.getName(), associatedObject); } else { makeChild(prop, data); } }
    private void setDefaultProperties(DataObject data,                                      DataObject associatedObject)        throws Exception {        final ObjectType type = data.getObjectType();        s_log.info("");        s_log.info("Making new object for: " + type.getQualifiedName());        KeyGenerator.setKeyValues(data);        PropertyManipulator.NonKeyManipulator manip =            new PropertyManipulator.NonKeyManipulator(type) {                public void manipulate(Property p, DataObject dataInner)                    throws Exception {                    m_manipulator.setDefaultProperty(p, dataInner);                }            };        PropertyManipulator.manipulateProperties(data, manip);        s_log.info("END new object.");        s_log.info("");        s_log.info("");    }