if (type.getJavaClass() != null) { write(" class "); write(type.getJavaClass().getName()); }     write(" {");  for (Iterator it = type.getDeclaredProperties().iterator(); it.hasNext(); ) { Property prop = (Property) it.next(); if (!(prop instanceof Role)) { continue; } Role role = (Role) prop; if (role.getName().startsWith("~")) { continue; } Role rev = role.getReverse(); if (rev != null && !rev.getName().startsWith("~")) { continue; } write("\n"); write(prop); }  ObjectMap om = type.getRoot().getObjectMap(type);  if (type.getSupertype() == null && type.isKeyed()) { write("\n\n    object key ("); for (Iterator it = type.getKeyProperties().iterator(); it.hasNext(); ) { Property prop = (Property) it.next(); write(prop.getName()); if (it.hasNext()) { write(", "); } } write(");"); } else if (om.getTable() != null) { write("\n\n    reference key ("); UniqueKey uk = om.getTable().getPrimaryKey(); write(uk.getColumns()); write(");"); }  write("\n}");
    public void write(ObjectType type) {	write("object type ");	write(type.getName());	if (type.getSupertype() != null) {	    write(" extends ");	    write(type.getSupertype().getQualifiedName());	}	if (type.getJavaClass() != null) {	    write(" class ");	    write(type.getJavaClass().getName());	}	// XXX: We don't store adapter names so we have no way of	// writing them out.	write(" {");	for (Iterator it = type.getDeclaredProperties().iterator();             it.hasNext(); ) {            Property prop = (Property) it.next();            if (!(prop instanceof Role)) { continue; }            Role role = (Role) prop;            if (role.getName().startsWith("~")) { continue; }            Role rev = role.getReverse();            if (rev != null && !rev.getName().startsWith("~")) { continue; }            write("\n");            write(prop);	}	ObjectMap om = type.getRoot().getObjectMap(type);	if (type.getSupertype() == null && type.isKeyed()) {	    write("\n\n    object key (");	    for (Iterator it = type.getKeyProperties().iterator();		 it.hasNext(); ) {		Property prop = (Property) it.next();		write(prop.getName());		if (it.hasNext()) {		    write(", ");		}	    }	    write(");");	} else if (om.getTable() != null) {	    write("\n\n    reference key (");	    UniqueKey uk = om.getTable().getPrimaryKey();	    write(uk.getColumns());	    write(");");	}	write("\n}");    }