for (Map.Entry<String, Object> entry : value.entrySet()) {
Object obj = entry.getValue();
Class<? extends Object> vClass = obj.getClass();
if ( obj instanceof NativeQueryResults ) {
obj = new FlatQueryResults( ((NativeQueryResults )obj).getResults() );
} else if (obj instanceof FactHandle && !(obj instanceof DisconnectedFactHandle)) {
obj = new DisconnectedFactHandle(((FactHandle) obj).toExternalForm());
} else if (List.class.isAssignableFrom(vClass) && !JaxbListWrapper.class.equals(vClass)) {
obj = new JaxbListWrapper( ((List<?>) obj).toArray( new Object[((List<?>) obj).size()]) );;
}