Examples of EntityQuerySpace


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

   * @param space The query space
   * @return a String containing details about the {@link QuerySpace}
   */
  public String extractDetails(QuerySpace space) {
    if ( EntityQuerySpace.class.isInstance( space ) ) {
      final EntityQuerySpace entityQuerySpace = (EntityQuerySpace) space;
      return String.format(
          "%s(uid=%s, entity=%s)",
          entityQuerySpace.getClass().getSimpleName(),
          entityQuerySpace.getUid(),
          entityQuerySpace.getEntityPersister().getEntityName()
      );
    }
    else if ( CompositeQuerySpace.class.isInstance( space ) ) {
      final CompositeQuerySpace compositeQuerySpace = (CompositeQuerySpace) space;
      return String.format(
View Full Code Here

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

    aliasResolutionContext.registerCompositeQuerySpaceUidResolution( rightHandSideUid, leftHandSideTableAlias );
  }

  private void renderEntityJoin(Join join, JoinFragment joinFragment) {
    final EntityQuerySpace rightHandSide = (EntityQuerySpace) join.getRightHandSide();

    // see if there is already aliases registered for this entity query space (collection joins)
    EntityReferenceAliases aliases = aliasResolutionContext.resolveEntityReferenceAliases( rightHandSide.getUid() );
    if ( aliases == null ) {
      aliasResolutionContext.generateEntityReferenceAliases(
          rightHandSide.getUid(),
          rightHandSide.getEntityPersister()
      );
    }

    final Joinable joinable = (Joinable) rightHandSide.getEntityPersister();
    addJoins(
        join,
        joinFragment,
        joinable
    );
View Full Code Here

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

    aliasResolutionContext.registerCompositeQuerySpaceUidResolution( rightHandSideUid, leftHandSideTableAlias );
  }

  private void renderEntityJoin(Join join, JoinFragment joinFragment) {
    final EntityQuerySpace rightHandSide = (EntityQuerySpace) join.getRightHandSide();

    // see if there is already aliases registered for this entity query space (collection joins)
    EntityReferenceAliases aliases = aliasResolutionContext.resolveEntityReferenceAliases( rightHandSide.getUid() );
    if ( aliases == null ) {
      aliasResolutionContext.generateEntityReferenceAliases(
          rightHandSide.getUid(),
          rightHandSide.getEntityPersister()
      );
    }

    final Joinable joinable = (Joinable) rightHandSide.getEntityPersister();
    addJoins(
        join,
        joinFragment,
        joinable
    );
View Full Code Here

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

    }
  }

  public String extractDetails(QuerySpace space) {
    if ( EntityQuerySpace.class.isInstance( space ) ) {
      final EntityQuerySpace entityQuerySpace = (EntityQuerySpace) space;
      return String.format(
          "%s(uid=%s, entity=%s)",
          entityQuerySpace.getClass().getSimpleName(),
          entityQuerySpace.getUid(),
          entityQuerySpace.getEntityPersister().getEntityName()
      );
    }
    else if ( CompositeQuerySpace.class.isInstance( space ) ) {
      final CompositeQuerySpace compositeQuerySpace = (CompositeQuerySpace) space;
      return String.format(
View Full Code Here

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

    aliasResolutionContext.registerCompositeQuerySpaceUidResolution( rightHandSideUid, leftHandSideTableAlias );
  }

  private void renderEntityJoin(Join join, JoinFragment joinFragment) {
    final EntityQuerySpace rightHandSide = (EntityQuerySpace) join.getRightHandSide();

    // see if there is already aliases registered for this entity query space (collection joins)
    EntityReferenceAliases aliases = aliasResolutionContext.resolveEntityReferenceAliases( rightHandSide.getUid() );
    if ( aliases == null ) {
      aliasResolutionContext.generateEntityReferenceAliases(
          rightHandSide.getUid(),
          rightHandSide.getEntityPersister()
      );
    }

    final Joinable joinable = (Joinable) rightHandSide.getEntityPersister();
    addJoins(
        join,
        joinFragment,
        joinable
    );
View Full Code Here

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

    }
  }

  public String extractDetails(QuerySpace space) {
    if ( EntityQuerySpace.class.isInstance( space ) ) {
      final EntityQuerySpace entityQuerySpace = (EntityQuerySpace) space;
      return String.format(
          "%s(uid=%s, entity=%s)",
          entityQuerySpace.getClass().getSimpleName(),
          entityQuerySpace.getUid(),
          entityQuerySpace.getEntityPersister().getEntityName()
      );
    }
    else if ( CompositeQuerySpace.class.isInstance( space ) ) {
      final CompositeQuerySpace compositeQuerySpace = (CompositeQuerySpace) space;
      return String.format(
View Full Code Here

Examples of org.hibernate.loader.plan2.spi.EntityQuerySpace

      throw new IllegalStateException( "QuerySpace with that UID was not yet registered in the AliasResolutionContext" );
    }

    final String[] aliasedLhsColumnNames = join.resolveAliasedLeftHandSideJoinConditionColumns( leftHandSideTableAlias );

    final EntityQuerySpace rightHandSide = (EntityQuerySpace) join.getRightHandSide();

    // see if there is already aliases registered for this entity query space (collection joins)
    EntityReferenceAliases aliases = aliasResolutionContext.resolveEntityReferenceAliases( rightHandSide.getUid() );
    if ( aliases == null ) {
        aliases = aliasResolutionContext.generateEntityReferenceAliases(
          rightHandSide.getUid(),
          rightHandSide.getEntityPersister()
      );
    }

    final String[] rhsColumnNames = join.resolveNonAliasedRightHandSideJoinConditionColumns();
    final String rhsTableAlias = aliases.getTableAlias();
    final AssociationType associationType = join instanceof JoinDefinedByMetadata ? ((JoinDefinedByMetadata)join).getJoinedAssociationPropertyType() : null;
    final String additionalJoinConditions = resolveAdditionalJoinCondition(
        rhsTableAlias,
        join.getAnyAdditionalJoinConditions( rhsTableAlias ),
        (Joinable) rightHandSide.getEntityPersister(),
        associationType
    );

    final Joinable joinable = (Joinable) rightHandSide.getEntityPersister();
    addJoins(
        joinFragment,
        joinable,
        join.isRightHandSideRequired() ? JoinType.INNER_JOIN : JoinType.LEFT_OUTER_JOIN,
        aliases.getTableAlias(),
View Full Code Here

Examples of org.hibernate.loader.plan2.spi.EntityQuerySpace

      AliasResolutionContextImpl aliasResolutionContext,
      QueryBuildingParameters buildingParameters,
      SessionFactoryImplementor factory) {
    // Should be just one querySpace (of type EntityQuerySpace) in querySpaces.  Should we validate that?
    // Should we make it a util method on Helper like we do for extractRootReturn ?
    final EntityQuerySpace rootQuerySpace = Helper.INSTANCE.extractRootQuerySpace(
        querySpaces,
        EntityQuerySpace.class
    );

    final EntityReferenceAliases entityReferenceAliases = aliasResolutionContext.generateEntityReferenceAliases(
        rootQuerySpace.getUid(),
        rootQuerySpace.getEntityPersister()
    );

    final String rootTableAlias = entityReferenceAliases.getTableAlias();
    applyTableFragments(
        select,
        factory,
        buildingParameters,
        rootTableAlias,
        (OuterJoinLoadable) rootQuerySpace.getEntityPersister()
    );

    // add restrictions...
    // first, the load key restrictions (which entity(s) do we want to load?)
    applyKeyRestriction(
        select,
        entityReferenceAliases.getTableAlias(),
        keyColumnNamesToUse,
        buildingParameters.getBatchSize()
    );

    // don't quite remember why these 2 anymore, todo : research that and document this code or remove it etc..
    final OuterJoinLoadable rootLoadable = (OuterJoinLoadable) rootQuerySpace.getEntityPersister();
    final Queryable rootQueryable = (Queryable) rootQuerySpace.getEntityPersister();
    select.appendRestrictions(
        rootQueryable.filterFragment(
            entityReferenceAliases.getTableAlias(),
            Collections.emptyMap()
        )
View Full Code Here

Examples of org.hibernate.loader.plan2.spi.EntityQuerySpace

    }
  }

  public String extractDetails(QuerySpace space) {
    if ( EntityQuerySpace.class.isInstance( space ) ) {
      final EntityQuerySpace entityQuerySpace = (EntityQuerySpace) space;
      return String.format(
          "%s(uid=%s, entity=%s)",
          entityQuerySpace.getClass().getSimpleName(),
          entityQuerySpace.getUid(),
          entityQuerySpace.getEntityPersister().getEntityName()
      );
    }
    else if ( CompositeQuerySpace.class.isInstance( space ) ) {
      final CompositeQuerySpace compositeQuerySpace = (CompositeQuerySpace) space;
      return String.format(
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.