Examples of QCat


Examples of com.mysema.query.jpa.domain.QCat

    @Test
    public void Delete() {
        session.save(new Cat("Bob",10));
        session.save(new Cat("Steve",11));

        QCat cat = QCat.cat;
        long amount = delete(cat).where(cat.name.eq("Bob"))
            .execute();
        assertEquals(1, amount);
    }
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

public class TupleTest extends AbstractQueryTest {
       
    @Test
    @Ignore // FIXME
    public void test() {
        QCat cat = QCat.cat;
       
        SubQueryExpression<?> subQuery = subQuery().from(cat)
        .where(subQuery()
           .from(cat)
           .groupBy(cat.mate)
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

    }
   
   
    @Test
    public void Arithmetic_And_Arithmetic2() {
        QCat c1 = new QCat("c1");
        QCat c2 = new QCat("c2");
        QCat c3 = new QCat("c3");
        assertToString("c1.id + c2.id * c3.id", c1.id.add(c2.id.multiply(c3.id)));
        assertToString("c1.id * (c2.id + c3.id)", c1.id.multiply(c2.id.add(c3.id)));
        assertToString("(c1.id + c2.id) * c3.id", c1.id.add(c2.id).multiply(c3.id));  
    }
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

    }

    @Test
    public void EntityQueries_CreateQuery() {
        SAnimal cat = new SAnimal("cat");
        QCat catEntity = QCat.cat;

        Query query = query().from(cat).createQuery(catEntity);
        assertEquals(6, query.list().size());
    }
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

    @Test
    @ExcludeIn(Target.MYSQL)
    public void EntityQueries_CreateQuery2() {
        SAnimal cat = new SAnimal("CAT");
        QCat catEntity = QCat.cat;

        Query query = query().from(cat).createQuery(catEntity);
        assertEquals(6, query.list().size());
    }
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

        this.entityManager = entityManager;
    }

    @Test
    public void test() {
        QCat cat = QCat.cat;
        JPAQuery query = query().from(cat);

        query.count();
        assertProjectionEmpty(query);
        query.distinct().count();
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

        assertProjectionEmpty(query);
    }

    @Test
    public void Clone() {
        QCat cat = QCat.cat;
        JPAQuery query = query().from(cat).where(cat.name.isNotNull());
        JPAQuery query2 = query.clone(entityManager);
        assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
        assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
        query2.list(cat);
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

    @Test
    public void ById_Qdsl() {
        long start = System.currentTimeMillis();
        for (int i = 0; i < iterations; i++) {
            QCat cat = QCat.cat;
            Cat c = query().from(cat).where(cat.id.eq(i+100)).uniqueResult(cat);
            assertNotNull(c);
        }
        System.err.println("by id - dsl" + (System.currentTimeMillis() - start));
    }
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

    @Test
    public void ById_TwoCols_Qdsl() {
        long start = System.currentTimeMillis();
        for (int i = 0; i < iterations; i++) {
            QCat cat = QCat.cat;
            Tuple row = query().from(cat).where(cat.id.eq(i+100)).uniqueResult(cat.id, cat.name);
            assertNotNull(row);
        }
        System.err.println("by id - 2 cols - dsl" + (System.currentTimeMillis() - start));
    }
View Full Code Here

Examples of com.mysema.query.jpa.domain.QCat

    @Test
    public void test() throws SecurityException, IllegalArgumentException,
            NoSuchMethodException, IllegalAccessException,
            InvocationTargetException, IOException {
        QCat cat = QCat.cat;
        HibernateQuery query = query().from(cat);
        new QueryMutability(query).test(cat, cat.name);
    }
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.