Package org.hibernate.loader.plan.spi

Examples of org.hibernate.loader.plan.spi.EntityFetch


      FetchOwner fetchOwner,
      AssociationAttributeDefinition attributeDefinition,
      FetchStrategy fetchStrategy,
      LoadPlanBuildingContext loadPlanBuildingContext) {

    return new EntityFetch(
        loadPlanBuildingContext.getSessionFactory(),
        LockMode.NONE, // todo : for now
        fetchOwner,
        attributeDefinition.getName(),
        fetchStrategy
View Full Code Here


  private void writeFetch(Fetch fetch, int depth, PrintWriter printWriter) {
    printWriter.print( TreePrinterHelper.INSTANCE.generateNodePrefix( depth ) );

    if ( EntityFetch.class.isInstance( fetch ) ) {
      final EntityFetch entityFetch = (EntityFetch) fetch;
      printWriter.println( extractDetails( entityFetch ) );
      writeEntityReferenceFetches( entityFetch, depth+1, printWriter );
    }
    else if ( CompositeFetch.class.isInstance( fetch ) ) {
      final CompositeFetch compositeFetch = (CompositeFetch) fetch;
View Full Code Here

          fetchStrategy
      );
      return false;
    }
    else if ( nature == AssociationAttributeDefinition.AssociationNature.ENTITY ) {
      EntityFetch fetch = currentSource.buildEntityAttributeFetch(
          attributeDefinition,
          fetchStrategy
      );
      if ( fetchStrategy.getStyle() == FetchStyle.JOIN ) {
        pushToStack( (ExpandingFetchSource) fetch );
View Full Code Here

    if ( ! FetchStrategyHelper.isJoinFetched( fetch.getFetchStrategy() ) ) {
      return;
    }

    if ( EntityFetch.class.isInstance( fetch ) ) {
      final EntityFetch entityFetch = (EntityFetch) fetch;
      processEntityFetch(
          selectStatementBuilder,
          fetchSource,
          entityFetch,
          readerCollector,
View Full Code Here

      );
      targetEntityReferenceInitializer.hydrateEntityState( resultSet, context );
    }
    for ( Fetch fetch : fetchSource.getFetches() ) {
      if ( EntityFetch.class.isInstance( fetch ) ) {
        final EntityFetch entityFetch = (EntityFetch) fetch;
        final EntityReferenceInitializer  entityReferenceInitializer = initializerByEntityReference.get( entityFetch );
        if ( entityReferenceInitializer != null ) {
          resolveEntityKey(
              resultSet,
              context,
View Full Code Here

    );
  }

  private void handleMissingIdentifier(ResultSetProcessingContext context) {
    if ( EntityFetch.class.isInstance( entityReference ) ) {
      final EntityFetch fetch = (EntityFetch) entityReference;
      final EntityType fetchedType = fetch.getFetchedType();
      if ( ! fetchedType.isOneToOne() ) {
        return;
      }

      final EntityReferenceProcessingState fetchOwnerState = context.getOwnerProcessingState( fetch );
View Full Code Here

    );
  }

  private void handleMissingIdentifier(ResultSetProcessingContext context) {
    if ( EntityFetch.class.isInstance( entityReference ) ) {
      final EntityFetch fetch = (EntityFetch) entityReference;
      final EntityType fetchedType = fetch.getFetchedType();
      if ( ! fetchedType.isOneToOne() ) {
        return;
      }

      final EntityReferenceProcessingState fetchOwnerState = context.getOwnerProcessingState( fetch );
View Full Code Here

    if ( ! FetchStrategyHelper.isJoinFetched( fetch.getFetchStrategy() ) ) {
      return;
    }

    if ( EntityFetch.class.isInstance( fetch ) ) {
      final EntityFetch entityFetch = (EntityFetch) fetch;
      processEntityFetch(
          selectStatementBuilder,
          factory,
          joinFragment,
          fetchOwner,
View Full Code Here

    // Otherwise, read it from the ResultSet
    final String[] columnNames;
    if ( EntityFetch.class.isInstance( entityReference )
        && !FetchStrategyHelper.isJoinFetched( ((EntityFetch) entityReference).getFetchStrategy() ) ) {
      final EntityFetch fetch = (EntityFetch) entityReference;
      final FetchOwner fetchOwner = fetch.getOwner();
      if ( EntityReference.class.isInstance( fetchOwner ) ) {
        throw new NotYetImplementedException();
//          final EntityReference ownerEntityReference = (EntityReference) fetchOwner;
//          final EntityAliases ownerEntityAliases = context.getAliasResolutionContext()
//              .resolveEntityColumnAliases( ownerEntityReference );
View Full Code Here

      //
      // how to best (a) find the bi-directionality and (b) represent that?

      if ( EntityFetch.class.isInstance( entityReference ) ) {
        // we just confirmed that EntityReference(Address) is an instance of EntityFetch(Address),
        final EntityFetch entityFetch = (EntityFetch) entityReference;
        final FetchOwner entityFetchOwner = entityFetch.getOwner();
        // so at this point we need to see if entityFetchOwner and attributeDefinition refer to the
        // "same thing".  "same thing" == "same type" && "same column(s)"?
        //
        // i make assumptions here that that the attribute type is the EntityType, is that always valid?
        final EntityType attributeDefinitionTypeAsEntityType = (EntityType) attributeDefinition.getType();

        final boolean sameType = attributeDefinitionTypeAsEntityType.getAssociatedEntityName().equals(
            entityFetchOwner.retrieveFetchSourcePersister().getEntityName()
        );

        if ( sameType ) {
          // check same columns as well?

          return new KeyManyToOneBidirectionalEntityFetch(
              sessionFactory(),
              //ugh
              LockMode.READ,
              this,
              attributeDefinition,
              (EntityReference) entityFetchOwner,
              fetchStrategy
          );
        }
      }

      final EntityFetch fetch = super.buildEntityFetch( attributeDefinition, fetchStrategy, loadPlanBuildingContext );

      // pretty sure this HydratedCompoundValueExtractor stuff is not needed...
      fetchToHydratedStateExtractorMap.put( fetch, attributeDefinition.getHydratedCompoundValueExtractor() );

      return fetch;
View Full Code Here

TOP

Related Classes of org.hibernate.loader.plan.spi.EntityFetch

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.