Interface SpannerMutationFactory
- All Known Implementing Classes:
SpannerMutationFactoryImpl
public interface SpannerMutationFactory
Interface for a factory that creates Cloud Spanner mutation operation objects.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescription<T> com.google.cloud.spanner.Mutation
Deletes several objects from Spanner.com.google.cloud.spanner.Mutation
Deletes a key from Spanner.com.google.cloud.spanner.Mutation
Deletes a set of keys from Spanner.<T> com.google.cloud.spanner.Mutation
delete
(T object) Deletes a single object from Spanner.List<com.google.cloud.spanner.Mutation>
Stores an object and its interleaved child properties in Cloud Spanner.List<com.google.cloud.spanner.Mutation>
Updates an object and its interleaved child properties in Cloud Spanner.List<com.google.cloud.spanner.Mutation>
Updates or inserts an object and its interleaved child properties in Cloud Spanner.
-
Method Details
-
insert
Stores an object and its interleaved child properties in Cloud Spanner. There will be 1 mutation for each entity corresponding to a row in Cloud Spanner. If there are no interleaved children then the returned list will contain the single mutation for the given object.- Parameters:
object
- the object to store.- Returns:
- the mutation operations which will store the object and its children.
-
upsert
Updates or inserts an object and its interleaved child properties in Cloud Spanner. There will be 1 mutation for each entity corresponding to a row in Cloud Spanner. If there are no interleaved children then the returned list will contain the single mutation for the given object.- Parameters:
object
- the object to update or newly insert.includeProperties
- the properties to use in the operation. if null then all properties are used.- Returns:
- the mutation operations which will store the object and its children.
-
update
Updates an object and its interleaved child properties in Cloud Spanner. There will be 1 mutation for each entity corresponding to a row in Cloud Spanner. If there are no interleaved children then the returned list will contain the single mutation for the given object.- Parameters:
object
- the object to update.includeProperties
- the properties to use in the operation. if null then all properties are used.- Returns:
- the mutation operations which will store the object and its children.
-
delete
Deletes several objects from Spanner.- Type Parameters:
T
- the type of object to delete.- Parameters:
entityClass
- the type of the objects to delete.entities
- a list of objects to delete. Each object can be a subtype of entityClass.- Returns:
- the delete mutation.
-
delete
<T> com.google.cloud.spanner.Mutation delete(T object) Deletes a single object from Spanner.- Type Parameters:
T
- the type of the object to delete.- Parameters:
object
- the object to delete.- Returns:
- the delete mutation.
-
delete
Deletes a set of keys from Spanner.- Parameters:
entityClass
- the type of the entity to delete.keys
- the keys of the objects to delete.- Returns:
- the delete mutation.
-
delete
Deletes a key from Spanner.- Parameters:
entityClass
- the type of the entity to delete.key
- the key of the object to delete.- Returns:
- the delete mutation.
-