Examples of generateEntityKey()


Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

    EntityPersister subclassPersister = factory.getEntityPersister( entry.getSubclass() );
    Object result = optionalObject == null ?
        session.instantiate( subclassPersister, id ) : optionalObject;

    // make it circular-reference safe
    final EntityKey entityKey = session.generateEntityKey( id, subclassPersister );
    TwoPhaseLoad.addUninitializedCachedEntity(
        entityKey,
        result,
        subclassPersister,
        LockMode.NONE,
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

      LOG.tracev( "Updating {0}",
          MessageHelper.infoString( persister, event.getRequestedId(), event.getSession().getFactory() ) );
    }

    final EventSource source = event.getSession();
    final EntityKey key = source.generateEntityKey( event.getRequestedId(), persister );

    source.getPersistenceContext().checkUniqueness(key, entity);

    if (invokeUpdateLifecycle(entity, persister, source)) {
            reassociate(event, event.getObject(), event.getRequestedId(), persister);
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

        throw new TransientObjectException(
            "the detached instance passed to delete() had a null identifier"
        );
      }

      final EntityKey key = source.generateEntityKey( id, persister );

      persistenceContext.checkUniqueness( key, entity );

      new OnUpdateVisitor( source, id, entity ).process( entity, persister );
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

    EntityPersister subclassPersister = factory.getEntityPersister( entry.getSubclass() );
    Object result = optionalObject == null ?
        session.instantiate( subclassPersister, id ) : optionalObject;

    // make it circular-reference safe
    final EntityKey entityKey = session.generateEntityKey( id, subclassPersister );
    TwoPhaseLoad.addUninitializedCachedEntity(
        entityKey,
        result,
        subclassPersister,
        LockMode.NONE,
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

        LOG.tracev( "No existing row, replicating new instance {0}",
            MessageHelper.infoString( persister, id, source.getFactory() ) );
      }

      final boolean regenerate = persister.isIdentifierAssignedByInsert(); // prefer re-generation of identity!
      final EntityKey key = regenerate ? null : source.generateEntityKey( id, persister );

      performSaveOrReplicate(
          entity,
          key,
          persister,
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

          ? session.instantiate( subclassPersister, entityId )
          : optionalObject;
    }

    // make it circular-reference safe
    final EntityKey entityKey = session.generateEntityKey( entityId, subclassPersister );
    TwoPhaseLoad.addUninitializedCachedEntity(
        entityKey,
        entity,
        subclassPersister,
        LockMode.NONE,
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

    EntityPersister subclassPersister = factory.getEntityPersister( entry.getSubclass() );
    Object result = optionalObject == null ?
        session.instantiate( subclassPersister, id ) : optionalObject;

    // make it circular-reference safe
    final EntityKey entityKey = session.generateEntityKey( id, subclassPersister );
    TwoPhaseLoad.addUninitializedCachedEntity(
        entityKey,
        result,
        subclassPersister,
        LockMode.NONE,
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

        throw new TransientObjectException(
            "the detached instance passed to delete() had a null identifier"
        );
      }

      final EntityKey key = source.generateEntityKey( id, persister );

      persistenceContext.checkUniqueness( key, entity );

      new OnUpdateVisitor( source, id, entity ).process( entity, persister );
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

    if ( LOG.isTraceEnabled() ) {
      LOG.tracev( "Reassociating transient instance: {0}", MessageHelper.infoString( persister, id, event.getSession().getFactory() ) );
    }

    final EventSource source = event.getSession();
    final EntityKey key = source.generateEntityKey( id, persister );

    source.getPersistenceContext().checkUniqueness( key, object );

    //get a snapshot
    Object[] values = persister.getPropertyValues( object );
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.generateEntityKey()

        EntityEntry entry = source.getPersistenceContext().getEntry( entity );
        if ( entry == null ) {
          EntityPersister persister = source.getEntityPersister( event.getEntityName(), entity );
          Serializable id = persister.getIdentifier( entity, source );
          if ( id != null ) {
            final EntityKey key = source.generateEntityKey( id, persister );
            final Object managedEntity = source.getPersistenceContext().getEntity( key );
            entry = source.getPersistenceContext().getEntry( managedEntity );
            if ( entry != null ) {
              // we have specialized case of a detached entity from the
              // perspective of the merge operation.  Specifically, we
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.