Examples of ReplicationMode


Examples of org.hibernate.ReplicationMode

    Serializable id = persister.getIdentifier( entity, source );
    if ( id == null ) {
      throw new TransientObjectException( "instance with null id passed to replicate()" );
    }

    final ReplicationMode replicationMode = event.getReplicationMode();

    final Object oldVersion;
    if ( replicationMode == ReplicationMode.EXCEPTION ) {
      //always do an INSERT, and let it fail by constraint violation
      oldVersion = null;
    }
    else {
      //what is the version on the database?
      oldVersion = persister.getCurrentVersion( id, source );
    }

    if ( oldVersion != null ) {
            if (LOG.isTraceEnabled()) LOG.trace("Found existing row for "
                                                + MessageHelper.infoString(persister, id, source.getFactory()));

      /// HHH-2378
      final Object realOldVersion = persister.isVersioned() ? oldVersion : null;

      boolean canReplicate = replicationMode.shouldOverwriteCurrentVersion(
          entity,
          realOldVersion,
          persister.getVersion( entity, source.getEntityMode() ),
          persister.getVersionType()
      );
View Full Code Here

Examples of org.hibernate.ReplicationMode

    Serializable id = persister.getIdentifier( entity, source.getEntityMode() );
    if (id==null) {
      throw new TransientObjectException("instance with null id passed to replicate()");
    }

    final ReplicationMode replicationMode = event.getReplicationMode();
   
    final Object oldVersion;
    if ( replicationMode == ReplicationMode.EXCEPTION ) {
      //always do an INSERT, and let it fail by constraint violation
      oldVersion = null;
    }
    else {
      //what is the version on the database?
      oldVersion = persister.getCurrentVersion(id, source);
    }

    if ( oldVersion!=null ) {
      //existing row - do an update if appropriate
      if ( log.isTraceEnabled() ) {
        log.trace( "found existing row for " +
          MessageHelper.infoString( persister, id, source.getFactory() ) );
      }

      boolean canReplicate = replicationMode.shouldOverwriteCurrentVersion(
          entity,
          oldVersion,
          persister.getVersion( entity, source.getEntityMode() ),
          persister.getVersionType()
      );
View Full Code Here

Examples of org.hibernate.ReplicationMode

    Serializable id = persister.getIdentifier( entity, source );
    if ( id == null ) {
      throw new TransientObjectException( "instance with null id passed to replicate()" );
    }

    final ReplicationMode replicationMode = event.getReplicationMode();

    final Object oldVersion;
    if ( replicationMode == ReplicationMode.EXCEPTION ) {
      //always do an INSERT, and let it fail by constraint violation
      oldVersion = null;
    }
    else {
      //what is the version on the database?
      oldVersion = persister.getCurrentVersion( id, source );
    }

    if ( oldVersion != null ) {
      if ( LOG.isTraceEnabled() ) {
        LOG.tracev( "Found existing row for {0}", MessageHelper.infoString( persister, id, source.getFactory() ) );
      }

      /// HHH-2378
      final Object realOldVersion = persister.isVersioned() ? oldVersion : null;

      boolean canReplicate = replicationMode.shouldOverwriteCurrentVersion(
          entity,
          realOldVersion,
          persister.getVersion( entity ),
          persister.getVersionType()
      );
View Full Code Here

Examples of org.hibernate.ReplicationMode

    Serializable id = persister.getIdentifier( entity, source );
    if ( id == null ) {
      throw new TransientObjectException( "instance with null id passed to replicate()" );
    }

    final ReplicationMode replicationMode = event.getReplicationMode();

    final Object oldVersion;
    if ( replicationMode == ReplicationMode.EXCEPTION ) {
      //always do an INSERT, and let it fail by constraint violation
      oldVersion = null;
    }
    else {
      //what is the version on the database?
      oldVersion = persister.getCurrentVersion( id, source );     
    }

    if ( oldVersion != null ) {      
      if ( log.isTraceEnabled() ) {
        log.trace(
            "found existing row for " +
                MessageHelper.infoString( persister, id, source.getFactory() )
        );
      }

      /// HHH-2378
      final Object realOldVersion = persister.isVersioned() ? oldVersion : null;
     
      boolean canReplicate = replicationMode.shouldOverwriteCurrentVersion(
          entity,
          realOldVersion,
          persister.getVersion( entity, source.getEntityMode() ),
          persister.getVersionType()
      );
View Full Code Here

Examples of org.hibernate.ReplicationMode

    Serializable id = persister.getIdentifier( entity, source );
    if ( id == null ) {
      throw new TransientObjectException( "instance with null id passed to replicate()" );
    }

    final ReplicationMode replicationMode = event.getReplicationMode();

    final Object oldVersion;
    if ( replicationMode == ReplicationMode.EXCEPTION ) {
      //always do an INSERT, and let it fail by constraint violation
      oldVersion = null;
    }
    else {
      //what is the version on the database?
      oldVersion = persister.getCurrentVersion( id, source );
    }

    final boolean traceEnabled = LOG.isTraceEnabled();
    if ( oldVersion != null ) {
      if ( traceEnabled ) {
        LOG.tracev( "Found existing row for {0}", MessageHelper.infoString( persister, id, source.getFactory() ) );
      }

      /// HHH-2378
      final Object realOldVersion = persister.isVersioned() ? oldVersion : null;

      boolean canReplicate = replicationMode.shouldOverwriteCurrentVersion(
          entity,
          realOldVersion,
          persister.getVersion( entity ),
          persister.getVersionType()
      );
View Full Code Here

Examples of org.hibernate.ReplicationMode

    Serializable id = persister.getIdentifier( entity, source );
    if ( id == null ) {
      throw new TransientObjectException( "instance with null id passed to replicate()" );
    }

    final ReplicationMode replicationMode = event.getReplicationMode();

    final Object oldVersion;
    if ( replicationMode == ReplicationMode.EXCEPTION ) {
      //always do an INSERT, and let it fail by constraint violation
      oldVersion = null;
    }
    else {
      //what is the version on the database?
      oldVersion = persister.getCurrentVersion( id, source );
    }

    if ( oldVersion != null ) {
            if (LOG.isTraceEnabled()) LOG.trace("Found existing row for "
                                                + MessageHelper.infoString(persister, id, source.getFactory()));

      /// HHH-2378
      final Object realOldVersion = persister.isVersioned() ? oldVersion : null;

      boolean canReplicate = replicationMode.shouldOverwriteCurrentVersion(
          entity,
          realOldVersion,
          persister.getVersion( entity ),
          persister.getVersionType()
      );
View Full Code Here

Examples of org.jboss.metadata.web.jboss.ReplicationMode

   }

   private Configuration applyOverrides(Configuration configuration, ReplicationConfig replConfig)
   {
      Integer backups = replConfig.getBackups();
      ReplicationMode replMode = replConfig.getReplicationMode();
     
      CacheMode mode = configuration.getCacheMode();
     
      if (backups != null)
      {
View Full Code Here

Examples of org.jboss.metadata.web.jboss.ReplicationMode

   }

   private void applyOverrides(Configuration configuration, ReplicationConfig replConfig)
   {
      Integer backups = replConfig.getBackups();
      ReplicationMode replMode = replConfig.getReplicationMode();
     
      CacheMode mode = configuration.getCacheMode();
     
      if (backups != null)
      {
View Full Code Here

Examples of org.jboss.metadata.web.jboss.ReplicationMode

   }

   private CacheMode getCacheMode(ReplicationConfig replConfig, Configuration configuration)
   {
      Integer backups = replConfig.getBackups();
      ReplicationMode replMode = replConfig.getReplicationMode();
     
      CacheMode mode = configuration.getCacheMode();
     
      if (backups != null)
      {
View Full Code Here

Examples of org.jboss.metadata.web.jboss.ReplicationMode

   }

   private Configuration applyOverrides(Configuration configuration, ReplicationConfig replConfig)
   {
      Integer backups = replConfig.getBackups();
      ReplicationMode replMode = replConfig.getReplicationMode();
     
      CacheMode mode = configuration.getCacheMode();
     
      if (backups != null)
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.