Examples of disableFilter()


Examples of org.hibernate.Session.disableFilter()

    s = openSession();
    tx = s.beginTransaction();
    s.enableFilter( "betweenLength" ).setParameter( "minLength", 5 ).setParameter( "maxLength", 50 );
    long count = ( (Long) s.createQuery( "select count(*) from Forest" ).iterate().next() ).intValue();
    assertEquals( 1, count );
    s.disableFilter( "betweenLength" );
    s.enableFilter( "minLength" ).setParameter( "minLength", 5 );
    count = ( (Long) s.createQuery( "select count(*) from Forest" ).iterate().next() ).longValue();
    assertEquals( 2l, count );
    s.disableFilter( "minLength" );
    tx.rollback();
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

    assertEquals( 1, count );
    s.disableFilter( "betweenLength" );
    s.enableFilter( "minLength" ).setParameter( "minLength", 5 );
    count = ( (Long) s.createQuery( "select count(*) from Forest" ).iterate().next() ).longValue();
    assertEquals( 2l, count );
    s.disableFilter( "minLength" );
    tx.rollback();
    s.close();
  }
   
  /**
 
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

    s.enableFilter( "byName" ).setParameter( "name", "HomeDrill1");
    long count = ( (Long) s.createQuery( "select count(*) from Drill" ).iterate().next() ).intValue();
    assertEquals( 1, count );
    count = ( (Long) s.createQuery( "select count(*) from PowerDrill" ).iterate().next() ).intValue();
    assertEquals( 1, count );
    s.disableFilter( "byName" );
   
    s.enableFilter( "byCategory" ).setParameter( "category", "Industrial" );
    count = ( (Long) s.createQuery( "select count(*) from Drill" ).iterate().next() ).longValue();
    assertEquals( 1, count );
    count = ( (Long) s.createQuery( "select count(*) from PowerDrill" ).iterate().next() ).longValue();
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

    s.enableFilter( "byCategory" ).setParameter( "category", "Industrial" );
    count = ( (Long) s.createQuery( "select count(*) from Drill" ).iterate().next() ).longValue();
    assertEquals( 1, count );
    count = ( (Long) s.createQuery( "select count(*) from PowerDrill" ).iterate().next() ).longValue();
    assertEquals( 1, count );
    s.disableFilter( "byCategory" );
   
    tx.rollback();
    s.close();
  }
 
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

    s.enableFilter( "sex" ).setParameter( "sexCode", new Character( 'F' ) );
    HQLQueryPlan plan2A = cache.getHQLQueryPlan( "from Person", true, getEnabledFilters( s ) );
    HQLQueryPlan plan2B = cache.getHQLQueryPlan( "from Person", false, getEnabledFilters( s ) );

    s.disableFilter( "sex" );
    HQLQueryPlan plan3A = cache.getHQLQueryPlan( "from Person", true, getEnabledFilters( s ) );
    HQLQueryPlan plan3B = cache.getHQLQueryPlan( "from Person", false, getEnabledFilters( s ) );

    s.enableFilter( "sex" ).setParameter( "sexCode", new Character( 'M' ) );
    HQLQueryPlan plan4A = cache.getHQLQueryPlan( "from Person", true, getEnabledFilters( s ) );
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

    Salesperson sp = ( Salesperson ) salespersons.get( 0 );
    assertEquals( "Incorrect order count", 1, sp.getOrders().size() );

    session.clear();

    session.disableFilter("regionlist");
    session.enableFilter( "regionlist" ).setParameterList( "regions", new String[]{"LA", "APAC", "APAC"} );
    // Second test retreival through hql with the collection as non-eager with different region list
    salespersons = session.createQuery( "select s from Salesperson as s" ).list();
    assertEquals( "Incorrect salesperson count", 1, salespersons.size() );
    sp = ( Salesperson ) salespersons.get( 0 );
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

    s = openSession();
    tx = s.beginTransaction();
    s.enableFilter( "betweenLength" ).setParameter( "minLength", 5 ).setParameter( "maxLength", 50 );
    long count = ( (Long) s.createQuery( "select count(*) from Forest" ).iterate().next() ).intValue();
    assertEquals( 1, count );
    s.disableFilter( "betweenLength" );
    s.enableFilter( "minLength" ).setParameter( "minLength", 5 );
    count = ( (Long) s.createQuery( "select count(*) from Forest" ).iterate().next() ).longValue();
    assertEquals( 2l, count );
    s.disableFilter( "minLength" );
    tx.rollback();
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

    assertEquals( 1, count );
    s.disableFilter( "betweenLength" );
    s.enableFilter( "minLength" ).setParameter( "minLength", 5 );
    count = ( (Long) s.createQuery( "select count(*) from Forest" ).iterate().next() ).longValue();
    assertEquals( 2l, count );
    s.disableFilter( "minLength" );
    tx.rollback();
    s.close();
  }

  public void testParameterizedType() throws Exception {
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

            throw new IllegalStateException("EntityManager must be open");
        }
        Session session = (Session) em.getDelegate();
        for (String filter : ONLY_SCOPE_FILTER)
        {
            session.disableFilter(filter);
        }

        return em;
    }
View Full Code Here

Examples of org.hibernate.Session.disableFilter()

        Session session = (Session) em.getDelegate();

        for (String filter : ONLY_TEMPORAL_FILTERS)
        {
            session.disableFilter(filter);
        }
        for (String filter : NOT_TEMPORAL_FILTERS)
        {
            session.disableFilter(filter);
        }
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.