public class SpannerMutationFactoryImpl extends Object implements SpannerMutationFactory
Constructor and Description |
---|
SpannerMutationFactoryImpl(SpannerConverter spannerConverter,
SpannerMappingContext spannerMappingContext)
Constructor
|
Modifier and Type | Method and Description |
---|---|
<T> com.google.cloud.spanner.Mutation |
delete(Class<T> entityClass,
Iterable<? extends T> entities)
Deletes several objects from Spanner.
|
com.google.cloud.spanner.Mutation |
delete(Class entityClass,
com.google.cloud.spanner.Key key)
Deletes a key from Spanner.
|
com.google.cloud.spanner.Mutation |
delete(Class entityClass,
com.google.cloud.spanner.KeySet keys)
Deletes a set of keys from Spanner.
|
com.google.cloud.spanner.Mutation |
delete(Object object)
Deletes a single object from Spanner.
|
com.google.cloud.spanner.Mutation |
insert(Object object)
Stores a single object in Spanner.
|
com.google.cloud.spanner.Mutation |
update(Object object,
Optional<Set<String>> includeColumns)
Updates a single object in Spanner.
|
com.google.cloud.spanner.Mutation |
upsert(Object object,
Optional<Set<String>> includeColumns)
Updates or inserts a single object in Spanner.
|
public SpannerMutationFactoryImpl(SpannerConverter spannerConverter, SpannerMappingContext spannerMappingContext)
spannerConverter
- The object mapper used to convert between objects and Spanner
data types.spannerMappingContext
- The mapping context used to get metadata from entity
types.public com.google.cloud.spanner.Mutation insert(Object object)
SpannerMutationFactory
insert
in interface SpannerMutationFactory
object
- The object to store.public com.google.cloud.spanner.Mutation upsert(Object object, Optional<Set<String>> includeColumns)
SpannerMutationFactory
upsert
in interface SpannerMutationFactory
object
- The object to update or newly insert.includeColumns
- The columns to use in the operation. if null or empty
Optional, then all columns are used.public com.google.cloud.spanner.Mutation update(Object object, Optional<Set<String>> includeColumns)
SpannerMutationFactory
update
in interface SpannerMutationFactory
object
- The object to update.includeColumns
- The columns to use in the operation. if null or empty
Optional, then all columns are used.public <T> com.google.cloud.spanner.Mutation delete(Class<T> entityClass, Iterable<? extends T> entities)
SpannerMutationFactory
delete
in interface SpannerMutationFactory
T
- The type of object to delete.entityClass
- The type of the objects to delete.entities
- A list of objects to delete. Each object can be a subtype of
entityClass.public com.google.cloud.spanner.Mutation delete(Object object)
SpannerMutationFactory
delete
in interface SpannerMutationFactory
object
- The object to delete.public com.google.cloud.spanner.Mutation delete(Class entityClass, com.google.cloud.spanner.KeySet keys)
SpannerMutationFactory
delete
in interface SpannerMutationFactory
entityClass
- The type of the entity to delete.keys
- The keys of the objects to delete.public com.google.cloud.spanner.Mutation delete(Class entityClass, com.google.cloud.spanner.Key key)
SpannerMutationFactory
delete
in interface SpannerMutationFactory
entityClass
- The type of the entity to delete.key
- The key of the object to delete.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.