DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Query query = new Query("NamespaceToUserMapping");
query.addFilter("email", Query.FilterOperator.EQUAL, email);
query.addFilter("confirmation", Query.FilterOperator.EQUAL, confirmation);
PreparedQuery preparedQuery = datastore.prepare(query);
Entity entity = preparedQuery.asSingleEntity();
if (entity == null) {
throw new IllegalArgumentException(String.format("No invitation was found for '%s' " +
"with confirmation code '%s'.", email, confirmation));
}