Package org.hibernate.hql.internal.ast.tree

Examples of org.hibernate.hql.internal.ast.tree.SqlFragment


      whereFragment = whereFragment.substring( 4 );
    }

    LOG.debugf( "Using unprocessed WHERE-fragment [%s]", whereFragment );

    SqlFragment fragment = (SqlFragment) create( SQL_TOKEN, whereFragment );
    fragment.setJoinFragment( joinFragment );
    fragment.setFromElement( fromElement );

    if ( fromElement.getIndexCollectionSelectorParamSpec() != null ) {
      fragment.addEmbeddedParameter( fromElement.getIndexCollectionSelectorParamSpec() );
      fromElement.setIndexCollectionSelectorParamSpec( null );
    }

    if ( hqlSqlWalker.isFilter() ) {
      if ( whereFragment.indexOf( '?' ) >= 0 ) {
        Type collectionFilterKeyType = hqlSqlWalker.getSessionFactoryHelper()
            .requireQueryableCollection( hqlSqlWalker.getCollectionFilterRole() )
            .getKeyType();
        CollectionFilterKeyParameterSpecification paramSpec = new CollectionFilterKeyParameterSpecification(
            hqlSqlWalker.getCollectionFilterRole(),
            collectionFilterKeyType,
            0
        );
        fragment.addEmbeddedParameter( paramSpec );
      }
    }

    JoinProcessor.processDynamicFilterParameters(
        whereFragment,
        fragment,
        hqlSqlWalker
    );

    if ( LOG.isDebugEnabled() ) {
      LOG.debugf( "Using processed WHERE-fragment [%s]", fragment.getText() );
    }

    // Filter conditions need to be inserted before the HQL where condition and the
    // theta join node.  This is because org.hibernate.loader.Loader binds the filter parameters first,
    // then it binds all the HQL query parameters, see org.hibernate.loader.Loader.processFilterParameters().
    if ( fragment.getFromElement().isFilter() || fragment.hasFilterCondition() ) {
      if ( filters == null ) {
        // Find or create the WHERE clause
        AST where = query.getWhereClause();
        // Create a new FILTERS node as a parent of all filters
        filters = create( FILTERS, "{filter conditions}" );
View Full Code Here


    // however it is probably not the best long-term solution.
    //
    // At some point we probably want to apply an additional grammar to
    // properly tokenize this where fragment into constituent parts
    // focused on the operators embedded within the fragment.
    SqlFragment discrimNode = (SqlFragment) create( SQL_TOKEN, whereFragment );

    JoinProcessor.processDynamicFilterParameters(
        whereFragment,
        discrimNode,
        hqlSqlWalker
View Full Code Here

      whereFragment = whereFragment.substring( 4 );
    }

    LOG.debugf( "Using unprocessed WHERE-fragment [%s]", whereFragment );

    SqlFragment fragment = ( SqlFragment ) create( SQL_TOKEN, whereFragment );
    fragment.setJoinFragment( joinFragment );
    fragment.setFromElement( fromElement );

    if ( fromElement.getIndexCollectionSelectorParamSpec() != null ) {
      fragment.addEmbeddedParameter( fromElement.getIndexCollectionSelectorParamSpec() );
      fromElement.setIndexCollectionSelectorParamSpec( null );
    }

    if ( hqlSqlWalker.isFilter() ) {
      if ( whereFragment.indexOf( '?' ) >= 0 ) {
        Type collectionFilterKeyType = hqlSqlWalker.getSessionFactoryHelper()
            .requireQueryableCollection( hqlSqlWalker.getCollectionFilterRole() )
            .getKeyType();
        CollectionFilterKeyParameterSpecification paramSpec = new CollectionFilterKeyParameterSpecification(
            hqlSqlWalker.getCollectionFilterRole(),
            collectionFilterKeyType,
            0
        );
        fragment.addEmbeddedParameter( paramSpec );
      }
    }

    JoinProcessor.processDynamicFilterParameters(
        whereFragment,
        fragment,
        hqlSqlWalker
    );

    if ( LOG.isDebugEnabled() ) {
      LOG.debugf( "Using processed WHERE-fragment [%s]", fragment.getText() );
    }

    // Filter conditions need to be inserted before the HQL where condition and the
    // theta join node.  This is because org.hibernate.loader.Loader binds the filter parameters first,
    // then it binds all the HQL query parameters, see org.hibernate.loader.Loader.processFilterParameters().
    if ( fragment.getFromElement().isFilter() || fragment.hasFilterCondition() ) {
      if ( filters == null ) {
        // Find or create the WHERE clause
        AST where = query.getWhereClause();
        // Create a new FILTERS node as a parent of all filters
        filters = create( FILTERS, "{filter conditions}" );
View Full Code Here

    // however it is probably not the best long-term solution.
    //
    // At some point we probably want to apply an additional grammar to
    // properly tokenize this where fragment into constituent parts
    // focused on the operators embedded within the fragment.
    SqlFragment discrimNode = ( SqlFragment ) create( SQL_TOKEN, whereFragment );

    JoinProcessor.processDynamicFilterParameters(
        whereFragment,
        discrimNode,
        hqlSqlWalker
View Full Code Here

      whereFragment = whereFragment.substring( 4 );
    }

        LOG.debugf("Using unprocessed WHERE-fragment [%s]", whereFragment);

    SqlFragment fragment = ( SqlFragment ) create( SQL_TOKEN, whereFragment );
    fragment.setJoinFragment( joinFragment );
    fragment.setFromElement( fromElement );

    if ( fromElement.getIndexCollectionSelectorParamSpec() != null ) {
      fragment.addEmbeddedParameter( fromElement.getIndexCollectionSelectorParamSpec() );
      fromElement.setIndexCollectionSelectorParamSpec( null );
    }

    if ( hqlSqlWalker.isFilter() ) {
      if ( whereFragment.indexOf( '?' ) >= 0 ) {
        Type collectionFilterKeyType = hqlSqlWalker.getSessionFactoryHelper()
            .requireQueryableCollection( hqlSqlWalker.getCollectionFilterRole() )
            .getKeyType();
        CollectionFilterKeyParameterSpecification paramSpec = new CollectionFilterKeyParameterSpecification(
            hqlSqlWalker.getCollectionFilterRole(),
            collectionFilterKeyType,
            0
        );
        fragment.addEmbeddedParameter( paramSpec );
      }
    }

    JoinProcessor.processDynamicFilterParameters(
        whereFragment,
        fragment,
        hqlSqlWalker
    );

        LOG.debugf("Using processed WHERE-fragment [%s]", fragment.getText());

    // Filter conditions need to be inserted before the HQL where condition and the
    // theta join node.  This is because org.hibernate.loader.Loader binds the filter parameters first,
    // then it binds all the HQL query parameters, see org.hibernate.loader.Loader.processFilterParameters().
    if ( fragment.getFromElement().isFilter() || fragment.hasFilterCondition() ) {
      if ( filters == null ) {
        // Find or create the WHERE clause
        AST where = query.getWhereClause();
        // Create a new FILTERS node as a parent of all filters
        filters = create( FILTERS, "{filter conditions}" );
View Full Code Here

    // however it is probably not the best long-term solution.
    //
    // At some point we probably want to apply an additional grammar to
    // properly tokenize this where fragment into constituent parts
    // focused on the operators embedded within the fragment.
    SqlFragment discrimNode = ( SqlFragment ) create( SQL_TOKEN, whereFragment );

    JoinProcessor.processDynamicFilterParameters(
        whereFragment,
        discrimNode,
        hqlSqlWalker
View Full Code Here

TOP

Related Classes of org.hibernate.hql.internal.ast.tree.SqlFragment

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.