Package org.apache.ojb.broker.query

Examples of org.apache.ojb.broker.query.Criteria.addBetween()


   */
    public void testBetweenCriteria()
    {

        Criteria crit = new Criteria();
        crit.addBetween("id", new Integer(1), new Integer(5));
        Query q = QueryFactory.newQuery(Person.class, crit);

        Collection results = broker.getCollectionByQuery(q);
        assertNotNull(results);
        assertTrue(results.size() == 5);
View Full Code Here


    protected void readArticlesByCursor() throws Exception
    {
        Connection conn = getConnection();

        Criteria c = new Criteria();
        c.addBetween("articleId", new Integer(offsetId), new Integer(offsetId + articleCount));
        Query query = new QueryByCriteria(PerformanceArticle.class, c);

        // Use the OJB SqlGenerator to generate SQL Statements. All details about
        // Table and column names are read from the repository.xml file.
        ClassDescriptor cld = broker.getClassDescriptor(PerformanceArticle.class);
View Full Code Here

    protected void readArticlesByCursor() throws PersistenceBrokerException

    {
        broker.clearCache();
        Criteria c = new Criteria();
        c.addBetween("articleId", new Integer(offsetId), new Integer(offsetId + articleCount));
        Query q = new QueryByCriteria(PerformanceArticle.class, c);

        long start = System.currentTimeMillis();
        Iterator iter = broker.getIteratorByQuery(q);
        int fetchCount = 0;
View Full Code Here

     */
    public void testBetweenCriteria()
    {

        Criteria crit = new Criteria();
        crit.addBetween("id", new Integer(1), new Integer(5));
        Query q = QueryFactory.newQuery(Person.class, crit);

        Collection results = broker.getCollectionByQuery(q);
        assertNotNull(results);
        assertTrue(results.size() == 5);
View Full Code Here

    protected void readArticlesByCursor() throws Exception
    {
        Connection conn = getConnection();

        Criteria c = new Criteria();
        c.addBetween("articleId", new Integer(offsetId), new Integer(offsetId + articleCount));
        Query query = new QueryByCriteria(PerformanceArticle.class, c);

        // Use the OJB SqlGenerator to generate SQL Statements. All details about
        // Table and column names are read from the repository.xml file.
        ClassDescriptor cld = broker.getClassDescriptor(PerformanceArticle.class);
View Full Code Here

        // clear the cache
        _conn.invalidateAll();

        Transaction tx = _kit.getTransaction(_conn);
        Criteria c = new Criteria();
        c.addBetween("articleId", new Integer(offsetId), new Integer(offsetId + articleCount));
        Query q = new QueryByCriteria(PerformanceArticle.class, c);
        long start = System.currentTimeMillis();
        tx.begin();
        Iterator iter = _conn.getIteratorByQuery(q, LockType.NO_LOCK);
        int fetchCount = 0;
View Full Code Here

   */
    public void testBetweenCriteria()
    {

        Criteria crit = new Criteria();
        crit.addBetween("id", new Integer(1), new Integer(5));
        Query q = QueryFactory.newQuery(Person.class, crit);

        Collection results = broker.getCollectionByQuery(q);
        assertNotNull(results);
        assertTrue(results.size() == 5);
View Full Code Here

        // clear the cache
        _conn.invalidateAll();

        Transaction tx = _kit.getTransaction(_conn);
        Criteria c = new Criteria();
        c.addBetween("articleId", new Integer(offsetId), new Integer(offsetId + articleCount));
        Query q = new QueryByCriteria(PerformanceArticle.class, c);
        long start = System.currentTimeMillis();
    tx.begin();
        Iterator iter = _conn.getIteratorByQuery(q, LockType.NO_LOCK);
        int fetchCount = 0;
View Full Code Here

    protected void readArticlesByCursor() throws Exception
    {
        Connection conn = getConnection();

        Criteria c = new Criteria();
        c.addBetween("articleId", new Integer(offsetId), new Integer(offsetId + articleCount));
        Query query = new QueryByCriteria(PerformanceArticle.class, c);

        // Use the OJB SqlGenerator to generate SQL Statements. All details about
        // Table and column names are read from the repository.xml file.
        ClassDescriptor cld = broker.getClassDescriptor(PerformanceArticle.class);
View Full Code Here

        {
            long start = System.currentTimeMillis();
            int artId = arr[0].articleId;

            Criteria c = new Criteria();
            c.addBetween("articleId", new Integer(artId), new Integer(artId + iterationsPerThread));
            Query q = new QueryByCriteria(PerformanceArticle.class, c);

            PersistenceBroker broker = null;
            try
            {
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.