}
if (query instanceof QueryFindByPattern) {
final QueryFindByPattern<?> queryByPattern = (QueryFindByPattern<?>) query;
final Object pattern = queryByPattern.getPattern();
final ObjectAdapter patternAdapter = getAdapterManager().adapterFor(pattern);
return new PersistenceQueryFindByPattern(noSpec, patternAdapter);
}
if (query instanceof QueryDefault) {
final QueryDefault<?> queryDefault = (QueryDefault<?>) query;
final String queryName = queryDefault.getQueryName();
final Map<String, ObjectAdapter> argumentsAdaptersByParameterName = wrap(queryDefault.getArgumentsByParameterName());