Package org.hibernate.loader.spi.ResultSetProcessingContext

Examples of org.hibernate.loader.spi.ResultSetProcessingContext.IdentifierResolutionContext


      ResultSet resultSet,
      ResultSetProcessingContext context,
      Fetch fetch) throws SQLException {
    if ( fetch instanceof EntityFetch ) {
      EntityFetch entityFetch = (EntityFetch) fetch;
      final IdentifierResolutionContext identifierResolutionContext =
          context.getIdentifierResolutionContext( entityFetch );
      if ( identifierResolutionContext.getEntityKey() != null ) {
        return;
      }

      EntityKey fetchKey = entityFetch.resolveInIdentifier( resultSet, context );
      identifierResolutionContext.registerEntityKey( fetchKey );
    }
    else if ( fetch instanceof CompositeFetch ) {
      for ( Fetch subFetch : ( (CompositeFetch) fetch ).getFetches() ) {
        resolveIdentifierFetch( resultSet, context, subFetch );
      }
View Full Code Here


      return identifierFetches;
    }

    @Override
    public void hydrate(ResultSet resultSet, ResultSetProcessingContext context) throws SQLException {
      final IdentifierResolutionContext ownerIdentifierResolutionContext =
          context.getIdentifierResolutionContext( entityReference );
      final Object ownerIdentifierHydratedState = ownerIdentifierResolutionContext.getHydratedForm();

      if ( ownerIdentifierHydratedState != null ) {
        for ( Fetch fetch : identifierFetches ) {
          if ( fetch instanceof EntityFetch ) {
            final IdentifierResolutionContext identifierResolutionContext =
                context.getIdentifierResolutionContext( (EntityFetch) fetch );
            // if the identifier was already hydrated, nothing to do
            if ( identifierResolutionContext.getHydratedForm() != null ) {
              continue;
            }
            // try to extract the sub-hydrated value from the owners tuple array
            if ( fetchToHydratedStateExtractorMap != null && ownerIdentifierHydratedState != null ) {
              Serializable extracted = (Serializable) fetchToHydratedStateExtractorMap.get( fetch )
                  .extract( ownerIdentifierHydratedState );
              identifierResolutionContext.registerHydratedForm( extracted );
              continue;
            }

            // if we can't, then read from result set
            fetch.hydrate( resultSet, context );
View Full Code Here

    public EntityKey resolve(ResultSet resultSet, ResultSetProcessingContext context) throws SQLException {
      for ( Fetch fetch : identifierFetches ) {
        resolveIdentifierFetch( resultSet, context, fetch );
      }

      final IdentifierResolutionContext ownerIdentifierResolutionContext =
          context.getIdentifierResolutionContext( entityReference );
      Object hydratedState = ownerIdentifierResolutionContext.getHydratedForm();
      Serializable resolvedId = (Serializable) entityReference.getEntityPersister()
          .getIdentifierType()
          .resolve( hydratedState, context.getSession(), null );
      return context.getSession().generateEntityKey( resolvedId, entityReference.getEntityPersister() );
    }
View Full Code Here

      return identifierFetches;
    }

    @Override
    public void hydrate(ResultSet resultSet, ResultSetProcessingContext context) throws SQLException {
      final IdentifierResolutionContext ownerIdentifierResolutionContext =
          context.getIdentifierResolutionContext( entityReference );
      final Object ownerIdentifierHydratedState = ownerIdentifierResolutionContext.getHydratedForm();

      if ( ownerIdentifierHydratedState != null ) {
        for ( EntityFetch fetch : identifierFetches ) {
          final IdentifierResolutionContext identifierResolutionContext =
              context.getIdentifierResolutionContext( fetch );
          // if the identifier was already hydrated, nothing to do
          if ( identifierResolutionContext.getHydratedForm() != null ) {
            continue;
          }

          // try to extract the sub-hydrated value from the owners tuple array
          if ( fetchToHydratedStateExtractorMap != null && ownerIdentifierHydratedState != null ) {
            Serializable extracted = (Serializable) fetchToHydratedStateExtractorMap.get( fetch )
                .extract( ownerIdentifierHydratedState );
            identifierResolutionContext.registerHydratedForm( extracted );
            continue;
          }

          // if we can't, then read from result set
          fetch.hydrate( resultSet, context );
View Full Code Here

    }

    @Override
    public EntityKey resolve(ResultSet resultSet, ResultSetProcessingContext context) throws SQLException {
      for ( EntityFetch fetch : identifierFetches ) {
        final IdentifierResolutionContext identifierResolutionContext =
            context.getIdentifierResolutionContext( fetch );
        if ( identifierResolutionContext.getEntityKey() != null ) {
          continue;
        }

        EntityKey fetchKey = fetch.resolveInIdentifier( resultSet, context );
        identifierResolutionContext.registerEntityKey( fetchKey );
      }

      final IdentifierResolutionContext ownerIdentifierResolutionContext =
          context.getIdentifierResolutionContext( entityReference );
      Object hydratedState = ownerIdentifierResolutionContext.getHydratedForm();
      Serializable resolvedId = (Serializable) entityReference.getEntityPersister()
          .getIdentifierType()
          .resolve( hydratedState, context.getSession(), null );
      return context.getSession().generateEntityKey( resolvedId, entityReference.getEntityPersister() );
    }
View Full Code Here

    }
  }

  @Override
  public void resolve(ResultSet resultSet, ResultSetProcessingContext context) throws SQLException {
    final IdentifierResolutionContext identifierResolutionContext = context.getIdentifierResolutionContext( this );
    EntityKey entityKey = identifierResolutionContext.getEntityKey();
    if ( entityKey != null ) {
      return;
    }

    entityKey = identifierDescription.resolve( resultSet, context );
    identifierResolutionContext.registerEntityKey( entityKey );

    for ( Fetch fetch : getFetches() ) {
      fetch.resolve( resultSet, context );
    }
  }
View Full Code Here

    return null;
  }
 
  @Override
  public void resolve(ResultSet resultSet, ResultSetProcessingContext context) throws SQLException {
    final IdentifierResolutionContext identifierResolutionContext = context.getIdentifierResolutionContext( this );
    EntityKey entityKey = identifierResolutionContext.getEntityKey();
    if ( entityKey != null ) {
      return;
    }

    entityKey = identifierDescription.resolve( resultSet, context );
    identifierResolutionContext.registerEntityKey( entityKey );

    for ( Fetch fetch : getFetches() ) {
      fetch.resolve( resultSet, context );
    }
  }
View Full Code Here

      return identifierFetches;
    }

    @Override
    public void hydrate(ResultSet resultSet, ResultSetProcessingContext context) throws SQLException {
      final IdentifierResolutionContext ownerIdentifierResolutionContext =
          context.getIdentifierResolutionContext( entityReference );
      final Object ownerIdentifierHydratedState = ownerIdentifierResolutionContext.getHydratedForm();

      if ( ownerIdentifierHydratedState != null ) {
        for ( Fetch fetch : identifierFetches ) {
          if ( fetch instanceof EntityFetch ) {
            final IdentifierResolutionContext identifierResolutionContext =
                context.getIdentifierResolutionContext( (EntityFetch) fetch );
            // if the identifier was already hydrated, nothing to do
            if ( identifierResolutionContext.getHydratedForm() != null ) {
              continue;
            }
            // try to extract the sub-hydrated value from the owners tuple array
            if ( fetchToHydratedStateExtractorMap != null && ownerIdentifierHydratedState != null ) {
              Serializable extracted = (Serializable) fetchToHydratedStateExtractorMap.get( fetch )
                  .extract( ownerIdentifierHydratedState );
              identifierResolutionContext.registerHydratedForm( extracted );
              continue;
            }

            // if we can't, then read from result set
            fetch.hydrate( resultSet, context );
View Full Code Here

    public EntityKey resolve(ResultSet resultSet, ResultSetProcessingContext context) throws SQLException {
      for ( Fetch fetch : identifierFetches ) {
        resolveIdentifierFetch( resultSet, context, fetch );
      }

      final IdentifierResolutionContext ownerIdentifierResolutionContext =
          context.getIdentifierResolutionContext( entityReference );
      Object hydratedState = ownerIdentifierResolutionContext.getHydratedForm();
      Serializable resolvedId = (Serializable) entityReference.getEntityPersister()
          .getIdentifierType()
          .resolve( hydratedState, context.getSession(), null );
      return context.getSession().generateEntityKey( resolvedId, entityReference.getEntityPersister() );
    }
View Full Code Here

      ResultSet resultSet,
      ResultSetProcessingContext context,
      Fetch fetch) throws SQLException {
    if ( fetch instanceof EntityFetch ) {
      EntityFetch entityFetch = (EntityFetch) fetch;
      final IdentifierResolutionContext identifierResolutionContext =
          context.getIdentifierResolutionContext( entityFetch );
      if ( identifierResolutionContext.getEntityKey() != null ) {
        return;
      }

      EntityKey fetchKey = entityFetch.resolveInIdentifier( resultSet, context );
      identifierResolutionContext.registerEntityKey( fetchKey );
    }
    else if ( fetch instanceof CompositeFetch ) {
      for ( Fetch subFetch : ( (CompositeFetch) fetch ).getFetches() ) {
        resolveIdentifierFetch( resultSet, context, subFetch );
      }
View Full Code Here

TOP

Related Classes of org.hibernate.loader.spi.ResultSetProcessingContext.IdentifierResolutionContext

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.