Examples of JoinSequence


Examples of org.hibernate.engine.internal.JoinSequence

   * @param collectionName The alias to use for qualifying column references.
   *
   * @return The generated join sequence.
   */
  public JoinSequence createCollectionJoinSequence(QueryableCollection collPersister, String collectionName) {
    JoinSequence joinSequence = createJoinSequence();
    joinSequence.setRoot( collPersister, collectionName );
    joinSequence.setUseThetaStyle( true );        // TODO: figure out how this should be set.
///////////////////////////////////////////////////////////////////////////////
// This was the reason for failures regarding INDEX_OP and subclass joins on
// theta-join dialects; not sure what behavior we were trying to emulate ;)
//    joinSequence = joinSequence.getFromPart();  // Emulate the old addFromOnly behavior.
    return joinSequence;
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

      collectionTableAlias = elem.getCollectionTableAlias();
    }

    // TODO: get SQL rendering out of here, create an AST for the join expressions.
    // Use the SQL generator grammar to generate the SQL text for the index expression.
    JoinSequence joinSequence = fromElement.getJoinSequence();
    String[] indexCols = queryableCollection.getIndexColumnNames();
    if ( indexCols.length != 1 ) {
      throw new QueryException( "composite-index appears in []: " + collectionNode.getPath() );
    }
    SqlGenerator gen = new SqlGenerator( getSessionFactoryHelper().getFactory() );
    try {
      gen.simpleExpr( selector ); //TODO: used to be exprNoParens! was this needed?
    }
    catch (RecognitionException e) {
      throw new QueryException( e.getMessage(), e );
    }
    String selectorExpression = gen.getSQL();
    joinSequence.addCondition( collectionTableAlias + '.' + indexCols[0] + " = " + selectorExpression );
    List<ParameterSpecification> paramSpecs = gen.getCollectedParameters();
    if ( paramSpecs != null ) {
      switch ( paramSpecs.size() ) {
        case 0:
          // nothing to do
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

            final FromElementFactory fromElementFactory = new FromElementFactory(
                fromClause, origin,
                attributeName, classAlias, columns, false
            );
            final JoinSequence joinSequence = walker.getSessionFactoryHelper().createJoinSequence(
                false, entityType, tableAlias, JoinType.LEFT_OUTER_JOIN, columns
            );
            fromElement = fromElementFactory.createEntityJoin(
                entityType.getAssociatedEntityName(),
                tableAlias,
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

    if ( alias != null ) {
      reset( q ); //reset the dotcount (but not the path)
      currentName = alias; //after reset!
      currentPropertyMapping = q.getPropertyMapping( currentName );
      if ( !ignoreInitialJoin ) {
        JoinSequence ojf = q.getPathJoin( path.toString() );
        try {
          joinSequence.addCondition( ojf.toJoinFragment( q.getEnabledFilters(), true ).toWhereFragmentString() ); //after reset!
        }
        catch ( MappingException me ) {
          throw new QueryException( me );
        }
        // we don't need to worry about any condition in the ON clause
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

  public void start(QueryTranslatorImpl q) {
    if ( !continuation ) {
      reset( q );
      path.setLength( 0 );
      joinSequence = new JoinSequence( q.getFactory() ).setUseThetaStyle( useThetaStyleJoin );
    }
  }
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

    if ( !collPersister.hasIndex() ) throw new QueryException( "unindexed collection before []: " + path );
    String[] indexCols = collPersister.getIndexColumnNames();
    if ( indexCols.length != 1 ) throw new QueryException( "composite-index appears in []: " + path );
    //String[] keyCols = collPersister.getKeyColumnNames();

    JoinSequence fromJoins = new JoinSequence( q.getFactory() )
        .setUseThetaStyle( useThetaStyleJoin )
        .setRoot( collPersister, collectionName )
        .setNext( joinSequence.copy() );

    if ( !continuation ) addJoin( collectionName, collPersister.getCollectionType() );
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

  }

  FromElement createCollectionElementsJoin(
      QueryableCollection queryableCollection,
      String collectionName) throws SemanticException {
    JoinSequence collectionJoinSequence = fromClause.getSessionFactoryHelper()
        .createCollectionJoinSequence( queryableCollection, collectionName );
    this.queryableCollection = queryableCollection;
    return createCollectionJoin( collectionJoinSequence, null );
  }
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

      // A collection of entities...
      elem = createEntityAssociation( role, roleAlias, joinType );
    }
    else if ( elementType.isComponentType() ) {
      // A collection of components...
      JoinSequence joinSequence = createJoinSequence( roleAlias, joinType );
      elem = createCollectionJoin( joinSequence, roleAlias );
    }
    else {
      // A collection of scalar elements...
      JoinSequence joinSequence = createJoinSequence( roleAlias, joinType );
      elem = createCollectionJoin( joinSequence, roleAlias );
    }

    elem.setRole( role );
    elem.setQueryableCollection( queryableCollection );
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

    String[] targetColumns = sfh.getCollectionElementColumns( role, roleAlias );
    AssociationType elementAssociationType = sfh.getElementAssociationType( type );

    // Create the join element under the from element.
    JoinType joinType = JoinType.INNER_JOIN;
    JoinSequence joinSequence = sfh.createJoinSequence(
        implied,
        elementAssociationType,
        tableAlias,
        joinType,
        targetColumns
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence

          "createEntityAssociation() : One to many - path = %s role = %s associatedEntityName = %s",
          path,
          role,
          associatedEntityName
      );
      JoinSequence joinSequence = createJoinSequence( roleAlias, joinType );

      elem = createJoin(
          associatedEntityName,
          roleAlias,
          joinSequence,
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.