DatabaseQuery applyToDatabaseQuery(Object valueToApply, DatabaseQuery query) {
if (query.isObjectLevelReadQuery()) {
if (valueToApply == QueryType.ReadAll) {
ReadAllQuery newQuery = new ReadAllQuery();
newQuery.copyFromQuery(query);
return newQuery;
} else if (valueToApply == QueryType.ReadObject) {
ReadObjectQuery newQuery = new ReadObjectQuery();
newQuery.copyFromQuery(query);
return newQuery;