return eventManager;
}
public QueryResponse onQuery(ObjectContext context, Query query) {
QueryResponse response = (QueryResponse) send(
new QueryMessage(query),
QueryResponse.class);
// if needed, register objects in provided context, rewriting the response
// (assuming all lists are mutable)
if (context != null) {
EntityResolver resolver = context.getEntityResolver();
QueryMetadata info = query.getMetaData(resolver);
if (!info.isFetchingDataRows()) {
response.reset();
while (response.next()) {
if (response.isList()) {
List objects = response.currentList();
if (!objects.isEmpty()) {
DeepMergeOperation merger = new DeepMergeOperation(context);