Examples of generateEntityKey()


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

        object,
        refreshedAlready
    );

    if ( e != null ) {
      final EntityKey key = source.generateEntityKey( id, persister );
      source.getPersistenceContext().removeEntity( key );
      if ( persister.hasCollections() ) {
        new EvictVisitor( source ).process( object, persister );
      }
    }
View Full Code Here

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

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

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

          ? 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()

      if ( id == null ) {
        throw new IllegalArgumentException( "Could not determine identifier of proxy passed to evict()" );
      }

      final EntityPersister persister = source.getFactory().getEntityPersister( li.getEntityName() );
      final EntityKey key = source.generateEntityKey( id, persister );
      persistenceContext.removeProxy( key );

      if ( !li.isUninitialized() ) {
        final Object entity = persistenceContext.removeEntity( key );
        if ( entity != null ) {
View Full Code Here

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

      persister = source.getEntityPersister(event.getEntityName(), object); //refresh() does not pass an entityName
      id = persister.getIdentifier( object, event.getSession() );
      if ( LOG.isTraceEnabled() ) {
        LOG.tracev( "Refreshing transient {0}", MessageHelper.infoString( persister, id, source.getFactory() ) );
      }
      final EntityKey key = source.generateEntityKey( id, persister );
      if ( source.getPersistenceContext().getEntry(key) != null ) {
        throw new PersistentObjectException(
            "attempted to refresh transient instance when persistent instance was already associated with the Session: " +
            MessageHelper.infoString(persister, id, source.getFactory() )
          );
View Full Code Here

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

    refreshedAlready.put(object, object);
    new Cascade( CascadingAction.REFRESH, Cascade.BEFORE_REFRESH, source)
        .cascade( persister, object, refreshedAlready );

    if ( e != null ) {
      final EntityKey key = source.generateEntityKey( id, persister );
      source.getPersistenceContext().removeEntity(key);
      if ( persister.hasCollections() ) new EvictVisitor( source ).process(object, persister);
    }

    if ( persister.hasCache() ) {
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.