Package org.hibernate.engine

Examples of org.hibernate.engine.EntityKey


                MessageHelper.infoString( persister, id, source.getFactory() )
        );
      }

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

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


    source.getPersistenceContext().addEntity(
        entity,
        Status.MANAGED,
        null,
        new EntityKey( id, persister, source.getEntityMode() ),
        version,
        LockMode.NONE,
        true,
        persister,
        true,
View Full Code Here

        );
      }

      final EventSource source = event.getSession();

      EntityKey key = new EntityKey( event.getRequestedId(), persister, source.getEntityMode() );

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

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

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

      EntityKey key = new EntityKey( id, persister, source.getEntityMode() );

      persistenceContext.checkUniqueness( key, entity );

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

        propTypes
    );

    // before any callbacks, etc, so subdeletions see that this deletion happened first
    persistenceContext.setEntryStatus( entityEntry, Status.DELETED );
    EntityKey key = new EntityKey( entityEntry.getId(), persister, session.getEntityMode() );

    cascadeBeforeDelete( session, persister, entity, entityEntry, transientEntities );

    new ForeignKeys.Nullifier( entity, true, false, session )
        .nullifyTransientReferences( entityEntry.getDeletedState(), propTypes );
View Full Code Here

            "Provided id of the wrong type. Expected: " + idClass + ", got " + event.getEntityId().getClass()
        );
      }
    }

    EntityKey keyToLoad = new EntityKey( event.getEntityId(), persister, source.getEntityMode()  );

    try {
      if ( loadType.isNakedEntityReturned() ) {
        //do not return a proxy!
        //(this option indicates we are initializing a proxy)
View Full Code Here

    Object result = optionalObject == null ?
        session.instantiate( subclassPersister, id ) : optionalObject;

    // make it circular-reference safe
    TwoPhaseLoad.addUninitializedCachedEntity(
        new EntityKey( id, subclassPersister, session.getEntityMode() ),
        result,
        subclassPersister,
        LockMode.NONE,
        entry.areLazyPropertiesUnfetched(),
        entry.getVersion(),
View Full Code Here

    }
   
    final PersistenceContext persistenceContext = session.getPersistenceContext();
   
    SubselectFetch subselect = persistenceContext.getBatchFetchQueue()
      .getSubselect( new EntityKey( key, getOwnerEntityPersister(), session.getEntityMode() ) );
   
    if (subselect == null) {
      return null;
    }
    else {
View Full Code Here

            "Provided id of the wrong type for class " + persister.getEntityName() + ". Expected: " + idClass + ", got " + event.getEntityId().getClass()
        );
      }
    }

    EntityKey keyToLoad = new EntityKey( event.getEntityId(), persister, source.getEntityMode()  );

    try {
      if ( loadType.isNakedEntityReturned() ) {
        //do not return a proxy!
        //(this option indicates we are initializing a proxy)
View Full Code Here

      LoadEvent event,
      LoadEventListener.LoadType options,
      EntityPersister dependentPersister,
      EmbeddedComponentType dependentIdType,
      EntityPersister parentPersister) {
    final EntityKey parentEntityKey = new EntityKey(
        event.getEntityId(),
        parentPersister,
        event.getSession().getEntityMode()
    );
    final Object parent = doLoad(
        event,
        parentPersister,
        parentEntityKey,
        options
    );

    Serializable dependent = (Serializable) dependentIdType.instantiate( parent, event.getSession() );
    dependentIdType.setPropertyValues( dependent, new Object[] {parent}, event.getSession().getEntityMode() );
    final EntityKey dependentEntityKey = new EntityKey(
        dependent,
        dependentPersister,
        event.getSession().getEntityMode()
    );
    event.setEntityId( dependent );
View Full Code Here

TOP

Related Classes of org.hibernate.engine.EntityKey

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.