Spring Data Core

org.springframework.data.crossstore
Interface ChangeSetPersister<K>

Type Parameters:
K - entity key

public interface ChangeSetPersister<K>

Interface to be implemented by classes that can synchronize between data stores and ChangeSets.

Author:
Rod Johnson

Nested Class Summary
static class ChangeSetPersister.NotFoundException
          Exception thrown in alternate control flow if getPersistentState finds no entity data.
 
Field Summary
static String CLASS_KEY
           
static String ID_KEY
           
 
Method Summary
 K getPersistentId(ChangeSetBacked entity, ChangeSet cs)
          Return id
 void getPersistentState(Class<? extends ChangeSetBacked> entityClass, K key, ChangeSet changeSet)
          TODO how to tell when not found?
 K persistState(ChangeSetBacked entity, ChangeSet cs)
          Return key
 

Field Detail

ID_KEY

static final String ID_KEY
See Also:
Constant Field Values

CLASS_KEY

static final String CLASS_KEY
See Also:
Constant Field Values
Method Detail

getPersistentState

void getPersistentState(Class<? extends ChangeSetBacked> entityClass,
                        K key,
                        ChangeSet changeSet)
                        throws DataAccessException,
                               ChangeSetPersister.NotFoundException
TODO how to tell when not found? throw exception?

Throws:
DataAccessException
ChangeSetPersister.NotFoundException

getPersistentId

K getPersistentId(ChangeSetBacked entity,
                  ChangeSet cs)
                  throws DataAccessException
Return id

Parameters:
entity -
cs -
Returns:
Throws:
DataAccessException

persistState

K persistState(ChangeSetBacked entity,
               ChangeSet cs)
               throws DataAccessException
Return key

Parameters:
entity -
cs - Key may be null if not persistent
Returns:
Throws:
DataAccessException

Spring Data Core

Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.