Skip to content

trevorism/datastore-client

Repository files navigation

datastore-client

Build GitHub last commit GitHub language count GitHub top language

Client Library for trevorism datastore.

Current Version

Supports classes with primitive types, Dates, Lists and Maps. Classes should have a String or long 'id' property

Pinging implementation

The pinging implementation will ping the datastore API on instantiation. The datastore API gets torn down, so a ping 'wakes' it up

Repository<MyClass> repo = new PingingDatastoreRepository<>(MyClass.class);

MyClass created = repo.create(myClass);
MyClass retrieved = repo.get("id");
MyClass updated = repo.update("id", myClass);
MyClass deleted = repo.delete("id");

Fast implementation

If the datastore is awoken, just call it with the fast implementation.

Repository<MyClass> repo = new FastDatastoreRepository<>(MyClass.class);

repo.ping();
for(MyClass myClass : list){
    repo.create(myClass);
}