result.addMapping(new Nested(Path.get(name), map));
Mapping m = new Static(Path.get(name)); m.setMap(map, false); result.addMapping(m); result.getKeyProperties().add(prop);
    static ObjectMap define(final String name, ObjectMap map) {        final ObjectType type = map.getObjectType();        Model anon = Model.getInstance("anonymous.define");        ObjectType def = new ObjectType            (anon, type.getQualifiedName() + "$" + name, (ObjectType) null) {            public String toString() {                return "{" + type + " " + name + ";" + "}";            }        };        Property prop = new Role(name, type, false, false, false);        def.addProperty(prop);        ObjectMap result = new ObjectMap(def);        result.addMapping(new Nested(Path.get(name), map));        return result;    }