Package org.hibernate

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 ) {      
      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


    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

    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 ) {      
      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

    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 ) {      
      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

    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

    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 ) {      
      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

    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

    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

    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

    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

TOP

Related Classes of org.hibernate.ReplicationMode

Copyright © 2018 www.massapicom. 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.