use of org.immutables.mongo.fixture.ent.EntRepository.Criteria in project immutables by immutables.
the class Ent method main.
public static void main(String... args) throws UnknownHostException {
MongoClient client = new MongoClient("localhost");
RepositorySetup setup = RepositorySetup.builder().database(client.getDB("test")).executor(MoreExecutors.listeningDecorator(Executors.newCachedThreadPool())).gson(new GsonBuilder().registerTypeAdapterFactory(new GsonAdaptersEnt()).create()).build();
EntRepository repository = new EntRepository(setup);
EntRepository.Criteria where = repository.criteria().uuid("8b7a881c-6ccb-4ada-8f6a-60cc99e6aa20").actionIn("BAN", "IPBAN");
Criteria or = where.expiresAbsent().or().with(where).expiresGreaterThan(TimeInstant.of(1467364749679L));
System.out.println(or);
repository.find(or).fetchAll().getUnchecked();
}
Aggregations