Package org.hibernate.impl

Examples of org.hibernate.impl.FilterImpl


      while ( tokens.hasMoreTokens() ) {
        final String token = tokens.nextToken();
        if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
          final String filterParameterName = token.substring( 1 );
          final String[] parts = parseFilterParameterName( filterParameterName );
          final FilterImpl filter = ( FilterImpl ) filters.get( parts[0] );
          final Object value = filter.getParameter( parts[1] );
          final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
          if ( value != null && Collection.class.isAssignableFrom( value.getClass() ) ) {
            Iterator itr = ( ( Collection ) value ).iterator();
            while ( itr.hasNext() ) {
              Object elementValue = itr.next();
              result.append( '?' );
View Full Code Here


    while ( tokens.hasMoreTokens() ) {
      final String token = tokens.nextToken();
      if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
        final String filterParameterName = token.substring( 1 );
        final String[] parts = QueryParameters.parseFilterParameterName( filterParameterName );
        final FilterImpl filter = ( FilterImpl ) walker.getEnabledFilters().get( parts[0] );
        final Object value = filter.getParameter( parts[1] );
        final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
        final String typeBindFragment = StringHelper.join(
            ",",
            ArrayHelper.fillArray( "?", type.getColumnSpan( walker.getSessionFactoryHelper().getFactory() ) )
        );
        final String bindFragment = ( value != null && Collection.class.isInstance( value ) )
View Full Code Here

      while ( tokens.hasMoreTokens() ) {
        final String token = tokens.nextToken();
        if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
          final String filterParameterName = token.substring( 1 );
          final String[] parts = parseFilterParameterName( filterParameterName );
          final FilterImpl filter = ( FilterImpl ) filters.get( parts[0] );
          final Object value = filter.getParameter( parts[1] );
          final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
          if ( value != null && Collection.class.isAssignableFrom( value.getClass() ) ) {
            Iterator itr = ( ( Collection ) value ).iterator();
            while ( itr.hasNext() ) {
              Object elementValue = itr.next();
              result.append( '?' );
View Full Code Here

      while ( tokens.hasMoreTokens() ) {
        final String token = tokens.nextToken();
        if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
          final String filterParameterName = token.substring( 1 );
          final String[] parts = parseFilterParameterName( filterParameterName );
          final FilterImpl filter = ( FilterImpl ) filters.get( parts[0] );
          final Object value = filter.getParameter( parts[1] );
          final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
          if ( value != null && Collection.class.isAssignableFrom( value.getClass() ) ) {
            Iterator itr = ( ( Collection ) value ).iterator();
            while ( itr.hasNext() ) {
              Object elementValue = itr.next();
              result.append( '?' );
View Full Code Here

  public static Set createFilterKeys(Map enabledFilters, EntityMode entityMode) {
    if ( enabledFilters.size()==0 ) return null;
    Set result = new HashSet();
    Iterator iter = enabledFilters.values().iterator();
    while ( iter.hasNext() ) {
      FilterImpl filter = (FilterImpl) iter.next();
      FilterKey key = new FilterKey(
          filter.getName(),
          filter.getParameters(),
          filter.getFilterDefinition().getParameterTypes(),
          entityMode
        );
      result.add(key);
    }
    return result;
View Full Code Here

  public static Set createFilterKeys(Map enabledFilters, EntityMode entityMode) {
    if ( enabledFilters.size()==0 ) return null;
    Set result = new HashSet();
    Iterator iter = enabledFilters.values().iterator();
    while ( iter.hasNext() ) {
      FilterImpl filter = (FilterImpl) iter.next();
      FilterKey key = new FilterKey(
          filter.getName(),
          filter.getParameters(),
          filter.getFilterDefinition().getParameterTypes(),
          entityMode
        );
      result.add(key);
    }
    return result;
View Full Code Here

    while ( tokens.hasMoreTokens() ) {
      final String token = tokens.nextToken();
      if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
        final String filterParameterName = token.substring( 1 );
        final String[] parts = QueryParameters.parseFilterParameterName( filterParameterName );
        final FilterImpl filter = ( FilterImpl ) walker.getEnabledFilters().get( parts[0] );
        final Object value = filter.getParameter( parts[1] );
        final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
        final String typeBindFragment = StringHelper.join(
            ",",
            ArrayHelper.fillArray( "?", type.getColumnSpan( walker.getSessionFactoryHelper().getFactory() ) )
        );
        final String bindFragment = ( value != null && Collection.class.isInstance( value ) )
View Full Code Here

  public Filter getEnabledFilter(String filterName) {
    return ( Filter ) enabledFilters.get( filterName );
  }

  public Filter enableFilter(String filterName) {
    FilterImpl filter = new FilterImpl( sessionFactory.getFilterDefinition( filterName ) );
    enabledFilters.put( filterName, filter );
    return filter;
  }
View Full Code Here

    enabledFilters.remove( filterName );
  }

  public Object getFilterParameterValue(String filterParameterName) {
    String[] parsed = parseFilterParameterName( filterParameterName );
    FilterImpl filter = ( FilterImpl ) enabledFilters.get( parsed[0] );
    if ( filter == null ) {
      throw new IllegalArgumentException( "Filter [" + parsed[0] + "] currently not enabled" );
    }
    return filter.getParameter( parsed[1] );
  }
View Full Code Here

      while ( tokens.hasMoreTokens() ) {
        final String token = tokens.nextToken();
        if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
          final String filterParameterName = token.substring( 1 );
          final String[] parts = LoadQueryInfluencers.parseFilterParameterName( filterParameterName );
          final FilterImpl filter = ( FilterImpl ) filters.get( parts[0] );
          final Object value = filter.getParameter( parts[1] );
          final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
          if ( value != null && Collection.class.isAssignableFrom( value.getClass() ) ) {
            Iterator itr = ( ( Collection ) value ).iterator();
            while ( itr.hasNext() ) {
              Object elementValue = itr.next();
              result.append( '?' );
View Full Code Here

TOP

Related Classes of org.hibernate.impl.FilterImpl

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.