public class SpannerMutationFactoryImpl extends Object implements SpannerMutationFactory
Constructor and Description |
---|
SpannerMutationFactoryImpl(SpannerEntityProcessor spannerEntityProcessor,
SpannerMappingContext spannerMappingContext,
SpannerSchemaUtils spannerSchemaUtils)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> Mutation |
delete(Class<T> entityClass,
Iterable<? extends T> entities)
Deletes several objects from Spanner.
|
Mutation |
delete(Class entityClass,
Key key)
Deletes a key from Spanner.
|
Mutation |
delete(Class entityClass,
KeySet keys)
Deletes a set of keys from Spanner.
|
<T> Mutation |
delete(T object)
Deletes a single object from Spanner.
|
List<Mutation> |
insert(Object object)
Stores an object and its interleaved child properties in Cloud Spanner.
|
List<Mutation> |
update(Object object,
Set<String> includeProperties)
Updates an object and its interleaved child properties in Cloud Spanner.
|
List<Mutation> |
upsert(Object object,
Set<String> includeProperties)
Updates or inserts an object and its interleaved child properties in Cloud Spanner.
|
public SpannerMutationFactoryImpl(SpannerEntityProcessor spannerEntityProcessor, SpannerMappingContext spannerMappingContext, SpannerSchemaUtils spannerSchemaUtils)
spannerEntityProcessor
- the object mapper used to convert between objects and Spanner
data types.spannerMappingContext
- the mapping context used to get metadata from entity types.spannerSchemaUtils
- the schema utility to usepublic List<Mutation> insert(Object object)
SpannerMutationFactory
insert
in interface SpannerMutationFactory
object
- the object to store.public List<Mutation> upsert(Object object, Set<String> includeProperties)
SpannerMutationFactory
upsert
in interface SpannerMutationFactory
object
- the object to update or newly insert.includeProperties
- the properties to use in the operation. if null then all properties
are used.public List<Mutation> update(Object object, Set<String> includeProperties)
SpannerMutationFactory
update
in interface SpannerMutationFactory
object
- the object to update.includeProperties
- the properties to use in the operation. if null then all properties
are used.public <T> 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 <T> Mutation delete(T object)
SpannerMutationFactory
delete
in interface SpannerMutationFactory
T
- the type of the object to delete.object
- the object to delete.public Mutation delete(Class entityClass, KeySet keys)
SpannerMutationFactory
delete
in interface SpannerMutationFactory
entityClass
- the type of the entity to delete.keys
- the keys of the objects to delete.public Mutation delete(Class entityClass, Key key)
SpannerMutationFactory
delete
in interface SpannerMutationFactory
entityClass
- the type of the entity to delete.key
- the key of the object to delete.Copyright © 2022. All rights reserved.