public class HibernateTopiaReplicationSupport extends Object implements TopiaReplicationSupport, TopiaReplicationDestination
| Modifier and Type | Field and Description |
|---|---|
protected TopiaHibernateSupport |
topiaHibernateSupport |
| Constructor and Description |
|---|
HibernateTopiaReplicationSupport(TopiaHibernateSupport topiaHibernateSupport) |
| Modifier and Type | Method and Description |
|---|---|
protected String[] |
buildQueries(Object... entityAndCondition)
Build the list of queries from the given parameter
entityAndCondition. |
void |
replicate(TopiaEntity entity)
Must replicate given entity in current database
|
void |
replicate(TopiaReplicationDestination topiaReplicationDestination,
Object... entityAndCondition)
Makes a replication of some entities from this context to the given
context without any entity modification.
|
protected void |
replicate0(TopiaReplicationDestination topiaReplicationDestination,
Object... entities) |
<T extends TopiaEntity> |
replicateEntities(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> |
replicateEntity(TopiaReplicationDestination topiaReplicationDestination,
T entity)
Replicate a given entity from this context to the given context.
|
protected TopiaHibernateSupport topiaHibernateSupport
public HibernateTopiaReplicationSupport(TopiaHibernateSupport topiaHibernateSupport)
public void replicate(TopiaReplicationDestination topiaReplicationDestination, Object... entityAndCondition) throws IllegalArgumentException
TopiaReplicationSupportentityAndCondition parameter 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 method TopiaReplicationSupport.replicateEntities(TopiaReplicationDestination, java.util.List).replicate in interface TopiaReplicationSupporttopiaReplicationDestination - the destination contextentityAndCondition - [key;value;...] parameter which key is the
entity class to replicate, and value the
"where" condition to use when querying entitiesIllegalArgumentException - if one of the context is closed or if
trying to replicate within the same
databasepublic <T extends TopiaEntity> void replicateEntity(TopiaReplicationDestination topiaReplicationDestination, T entity) throws IllegalArgumentException
TopiaReplicationSupportreplicateEntity in interface TopiaReplicationSupportT - type of entitytopiaReplicationDestination - the destination contextentity - the entity instance to replicateIllegalArgumentException - if one of the context is closed or if
trying to replicate within the same
databasepublic <T extends TopiaEntity> void replicateEntities(TopiaReplicationDestination topiaReplicationDestination, List<T> entities) throws IllegalArgumentException
TopiaReplicationSupportreplicateEntities in interface TopiaReplicationSupportT - type of entitytopiaReplicationDestination - the destination contextentities - the list of entities instance to replicateIllegalArgumentException - if one of the context is closed or if
trying to replicate within the same
databaseprotected void replicate0(TopiaReplicationDestination topiaReplicationDestination, Object... entities)
protected String[] buildQueries(Object... entityAndCondition) throws TopiaException, IllegalArgumentException
entityAndCondition.
If no parameter is given, then build the queries for all entities is db,
with no condition.entityAndCondition - the list of tuples (Class,String)TopiaException - if any pb of db while getting entities
classes.IllegalArgumentException - if any pb with the given parameter
(mainly ClassCastException).public void replicate(TopiaEntity entity)
TopiaReplicationDestinationreplicate in interface TopiaReplicationDestinationentity - the remote entity to replicateCopyright © 2004–2017 CodeLutin. All rights reserved.