Example #1
0
  @Override
  public List<ObjectAdapter> loadInstancesAndAdapt(final PersistenceQuery persistenceQuery)
      throws ObjectPersistenceException, UnsupportedFindException {

    if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
      throw new IllegalArgumentException(
          MessageFormat.format(
              "Provided PersistenceQuery not supported; was {0}; "
                  + "the in-memory object store only supports {1}",
              persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
    }
    final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

    final List<ObjectAdapter> instances = Lists.newArrayList();
    final ObjectSpecification spec = persistenceQuery.getSpecification();
    findInstances(spec, builtIn, instances);
    return resolved(instances);
  }