Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ interface Response {
/**
* {@inheritDoc}
*
* <p>If an entity for {@code entity.getKey()} does not exists, {@code entity} is inserted.
* <p>If an entity for {@code entity.getKey()} does not exist, {@code entity} is inserted.
* Otherwise, {@link #submit()} will throw a {@link DatastoreException} with {@link
* DatastoreException#getReason()} equal to {@code "ALREADY_EXISTS"}.
*
* @param entity the entity to be added to the datastore
* @return The entity that was added
* @throws DatastoreException if there was any failure
*/
@Override
Entity add(FullEntity<?> entity);
Expand All @@ -67,17 +71,26 @@ interface Response {
* exists, {@link #submit()} will throw a {@link DatastoreException} with {@link
* DatastoreException#getReason()} equal to {@code "ALREADY_EXISTS"}. All entities in {@code
* entities} whose key did not exist are inserted.
*
* @param entities entities to be added to the datastore
* @return A list of entities that have been added
* @throws DatastoreException if there was any failure
*/
@Override
List<Entity> add(FullEntity<?>... entities);

/**
* Submit the batch to the Datastore.
*
* @throws DatastoreException if there was any failure or if batch is not longer active
* @return Response of the batch submit operation.
* @throws DatastoreException if there was any failure or if batch is no longer active
*/
Response submit();

/** Returns the batch associated {@link Datastore}. */
/**
* Returns the batch associated {@link Datastore}.
*
* @return The batch associated datastore
*/
Datastore getDatastore();
}
Loading