Skip to content

Commit

Permalink
return the datastore service from Batch and Transation
Browse files Browse the repository at this point in the history
  • Loading branch information
aozarov committed Feb 10, 2015
1 parent beac379 commit 0ae2558
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/google/gcloud/datastore/Batch.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ interface Response {
* @throws DatastoreServiceException if there was any failure or if batch is not longer active
*/
Response submit();

/**
* Returns the batch associated {@link DatastoreService}.
*/
DatastoreService datastore();
}
5 changes: 5 additions & 0 deletions src/main/java/com/google/gcloud/datastore/BatchImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,9 @@ public Batch.Response submit() {
deactivate();
return new ResponseImpl(responsePb);
}

@Override
public DatastoreService datastore() {
return datastore;
}
}
5 changes: 5 additions & 0 deletions src/main/java/com/google/gcloud/datastore/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,9 @@ interface Response {
*/
@Override
boolean active();

/**
* Returns the transaction associated {@link DatastoreService}.
*/
DatastoreService datastore();
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,9 @@ public void rollback() {
deactivate();
rolledback = true;
}

@Override
public DatastoreService datastore() {
return datastore;
}
}

0 comments on commit 0ae2558

Please sign in to comment.