Class ReplicationServiceBean

All Implemented Interfaces:
IBatchService, IGenericBaseService, IGenericLocalService, IGenericService, INamedQueryService, IQueryService, IStatelessService

public class ReplicationServiceBean extends GenericLocalServiceBean
Service for persistence-unit 'replication'
Version:
$Revision$
Author:
Tom, Thomas Schneider
  • Constructor Details

    • ReplicationServiceBean

      public ReplicationServiceBean()
      constructor
    • ReplicationServiceBean

      public ReplicationServiceBean(javax.persistence.EntityManager entityManager)
      constructor
      Parameters:
      entityManager -
  • Method Details

    • persistCollection

      public <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.
      Specified by:
      persistCollection in interface IGenericBaseService
      Overrides:
      persistCollection in class GenericLocalServiceBean
      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:
      persistNoTransaction in interface IGenericBaseService
      Overrides:
      persistNoTransaction in class GenericReplicatingServiceBean