Class ReplicationServiceBean
java.lang.Object
de.tsl2.nano.service.util.AbstractStatelessServiceBean
de.tsl2.nano.service.util.NamedQueryServiceBean
de.tsl2.nano.service.util.GenericServiceBean
de.tsl2.nano.persistence.replication.GenericReplicatingServiceBean
de.tsl2.nano.persistence.GenericLocalServiceBean
de.tsl2.nano.persistence.replication.ReplicationServiceBean
- All Implemented Interfaces:
IBatchService,IGenericBaseService,IGenericLocalService,IGenericService,INamedQueryService,IQueryService,IStatelessService
Service for persistence-unit 'replication'
- Version:
- $Revision$
- Author:
- Tom, Thomas Schneider
-
Field Summary
Fields inherited from class de.tsl2.nano.persistence.GenericLocalServiceBean
GENERIC_PERSISTENCE_UNITFields inherited from class de.tsl2.nano.persistence.replication.GenericReplicatingServiceBean
collectReplications, connected, replication, replicationServicesFields inherited from class de.tsl2.nano.service.util.AbstractStatelessServiceBean
entityManagerFields inherited from interface de.tsl2.nano.service.util.INamedQueryService
NAMEDQUERY_ALL, NAMEDQUERY_BETWEEN, NAMEDQUERY_DELETE, NAMEDQUERY_ID, NAMEDQUERY_INSERT, NAMEDQUERY_UPDATE -
Constructor Summary
ConstructorsConstructorDescriptionconstructorReplicationServiceBean(javax.persistence.EntityManager entityManager) constructor -
Method Summary
Modifier and TypeMethodDescription<T> Collection<T>persistCollection(Collection<T> beans, Class... lazyRelations) this extension tries to persist new data from source db to this replication db. the method#addReplicationEntities(de.tsl2.nano.service.util.IGenericBaseService, java.util.List, java.util.List)inserts all unpersisted relations - but in an undefined order. so we have to try to persist the collection for several times. if no element was persisted in one loop, the trial and error job stops.<T> TpersistNoTransaction(T bean, boolean refreshBean, boolean flush, Class... lazyRelations) protected <T> TpersistRep(T bean) persistRepMethods inherited from class de.tsl2.nano.persistence.GenericLocalServiceBean
createEntityManager, executeQuery, persist, remove, setEntityManagerMethods inherited from class de.tsl2.nano.persistence.replication.GenericReplicatingServiceBean
addReplicationEntities, addReplicationEntities, checkConnection, checkConnection, connection, createStandardReplication, doForReplication, findByQuery, getAvailableReplication, switchToConnectionMethods inherited from class de.tsl2.nano.service.util.GenericServiceBean
createQuery, fillTree, find, findAll, findAll, findAll, findBatch, findBetween, findBetween, findBetween, findByExample, findByExample, findByExample, findByExampleLike, findByExampleLike, findById, findByQuery, findByQuery, findHolders, findItemByQuery, findMembers, findValueByQuery, getUser, instantiateLazyRelationship, instantiateLazyRelationship, instantiateLazyRelationship, instantiateLazyRelationship, instantiateLazyRelationship, persist, persistAll, refresh, removeCollectionMethods inherited from class de.tsl2.nano.service.util.NamedQueryServiceBean
findByNamedQuery, getNamedQueryByArguments, getNamedQueryPrefix, isNamedQuery, isVirtualEntity, persistByNamedQuery, removeByNamedQueryMethods inherited from class de.tsl2.nano.service.util.AbstractStatelessServiceBean
checkContextSecurity, finalize, formatQuery, getEntityTypes, getLazyRelationType, getMaxRecursionLevel, getMaxResult, getServerInfo, initServerSideFactories, isLazyLoadingOnlyOnOneToMany, logTrace, setParameterMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.tsl2.nano.service.util.IGenericLocalService
initServerSideFactoriesMethods inherited from interface de.tsl2.nano.service.util.IGenericService
initServerSideFactoriesMethods inherited from interface de.tsl2.nano.service.util.INamedQueryService
findByNamedQueryMethods inherited from interface de.tsl2.nano.service.util.IStatelessService
getServerInfo
-
Constructor Details
-
ReplicationServiceBean
public ReplicationServiceBean()constructor -
ReplicationServiceBean
public ReplicationServiceBean(javax.persistence.EntityManager entityManager) constructor- Parameters:
entityManager-
-
-
Method Details
-
persistCollection
this extension tries to persist new data from source db to this replication db. the method#addReplicationEntities(de.tsl2.nano.service.util.IGenericBaseService, java.util.List, java.util.List)inserts all unpersisted relations - but in an undefined order. so we have to try to persist the collection for several times. if no element was persisted in one loop, the trial and error job stops.- Specified by:
persistCollectionin interfaceIGenericBaseService- Overrides:
persistCollectionin classGenericLocalServiceBean- See Also:
-
de.tsl2.nano.service.util.GenericServiceBean#persist(java.util.Collection)
-
persistRep
protected <T> T persistRep(T bean) persistRep- Parameters:
bean-- Returns:
-
persistNoTransaction
public <T> T persistNoTransaction(T bean, boolean refreshBean, boolean flush, Class... lazyRelations) - Specified by:
persistNoTransactionin interfaceIGenericBaseService- Overrides:
persistNoTransactionin classGenericReplicatingServiceBean
-