Interface TopiaReplicationSupport
- All Known Subinterfaces:
TopiaPersistenceContext
- All Known Implementing Classes:
AbstractTopiaPersistenceContext,HibernateTopiaReplicationSupport
public interface TopiaReplicationSupport
This API provides methods about entities replication to a destination
- Since:
- 3.0
- Author:
- Arnaud Thimel (Code Lutin)
-
Method Summary
Modifier and TypeMethodDescriptionvoidreplicate(TopiaReplicationDestination topiaReplicationDestination, Object... entityAndCondition) Makes a replication of some entities from this context to the given context without any entity modification.<T extends TopiaEntity>
voidreplicateEntities(TopiaReplicationDestination topiaReplicationDestination, List<T> entities) Makes a replication of some entities from this context to the given context without any entity modification.<T extends TopiaEntity>
voidreplicateEntity(TopiaReplicationDestination topiaReplicationDestination, T entity) Replicate a given entity from this context to the given context.
-
Method Details
-
replicate
void replicate(TopiaReplicationDestination topiaReplicationDestination, Object... entityAndCondition) throws IllegalArgumentException Makes a replication of some entities from this context to the given context without any entity modification. Note: If theentityAndConditionparameter is empty, all the database will be replicated Note 2: The simple replication may not be sufficent. You may want to replicate only a part of some entities : use the methodreplicateEntities(TopiaReplicationDestination, java.util.List).- Parameters:
topiaReplicationDestination- the destination contextentityAndCondition- [key;value;...] parameter which key is the entity class to replicate, and value the "where" condition to use when querying entities- Throws:
IllegalArgumentException- if one of the context is closed or if trying to replicate within the same database
-
replicateEntity
<T extends TopiaEntity> void replicateEntity(TopiaReplicationDestination topiaReplicationDestination, T entity) throws IllegalArgumentException Replicate a given entity from this context to the given context.- Type Parameters:
T- type of entity- Parameters:
topiaReplicationDestination- the destination contextentity- the entity instance to replicate- Throws:
IllegalArgumentException- if one of the context is closed or if trying to replicate within the same database
-
replicateEntities
<T extends TopiaEntity> void replicateEntities(TopiaReplicationDestination topiaReplicationDestination, List<T> entities) throws IllegalArgumentException Makes a replication of some entities from this context to the given context without any entity modification.- Type Parameters:
T- type of entity- Parameters:
topiaReplicationDestination- the destination contextentities- the list of entities instance to replicate- Throws:
IllegalArgumentException- if one of the context is closed or if trying to replicate within the same database
-