public void deleteOnQuery(final TokenFilter filter) throws CoreTokenException, IllegalArgumentException {
  filter.addReturnAttribute(CoreTokenField.TOKEN_ID);
  ResultHandler<Collection<PartialToken>,CoreTokenException> handler=handlerFactory.getDeleteOnQueryHandler();
  try {
    attributeQueryWithHandler(filter,handler);
  }
 catch (  CoreTokenException e) {
    throw new QueryFailedException(filter,e);
  }
}

public void deleteOnQuery ( final TokenFilter filter ) throws CoreTokenException , IllegalArgumentException { filter . addReturnAttribute ( CoreTokenField . TOKEN_ID ) ; ResultHandler < Collection < PartialToken > , CoreTokenException > handler = handlerFactory . getDeleteOnQueryHandler ( ) ; try { attributeQueryWithHandler ( filter , handler ) ; } catch ( CoreTokenException e ) { throw new QueryFailedException ( filter , e ) ; } }
queries the persistence layer using the given tokenfilter which must have the required ' return attributes ' defined within it . the results of this query then will be deleted from the store .
