Examples of QCat


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

        new QueryMutability(query).test(cat, cat.name);
    }

    @Test
    public void Clone() {
        QCat cat = QCat.cat;
        HibernateQuery query = query().from(cat).where(cat.name.isNotNull());
        HibernateQuery query2 = query.clone(session);
        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 EntityQueries() {
        QCat catEntity = QCat.cat;

        List<Cat> cats = query().from(cat).orderBy(cat.name.asc()).list(catEntity);
        assertEquals(6, cats.size());
        for (Cat c : cats) {
            System.out.println(c.getName());
View Full Code Here

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

    }

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

        List<Cat> cats = query().from(cat)
                .innerJoin(mate).on(cat.mateId.eq(mate.id))
                .where(cat.dtype.eq("C"), mate.dtype.eq("C"))
                .list(catEntity);
View Full Code Here

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

        assertTrue(cats.isEmpty());
    }

    @Test
    public void EntityQueries3() {
        QCat catEntity = new QCat("animal_");
        query().from(catEntity).list(catEntity.toes.max());
    }
View Full Code Here

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

    @Test
    @NoBatooJPA
    @NoEclipseLink
    public void EntityQueries4() {
        QCat catEntity = QCat.cat;
        List<Tuple> cats = query().from(cat).list(catEntity, cat.name, cat.id);
        assertEquals(6, cats.size());

        for (Tuple tuple : cats) {
            assertTrue(tuple.get(catEntity) instanceof Cat);
View Full Code Here

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

    @Test
    @NoBatooJPA
    @NoEclipseLink
    public void EntityQueries5() {
        QCat catEntity = QCat.cat;
        SAnimal otherCat = new SAnimal("otherCat");
        QCat otherCatEntity = new QCat("otherCat");
        List<Tuple> cats = query().from(cat, otherCat).list(catEntity, otherCatEntity);
        assertEquals(36, cats.size());

        for (Tuple tuple : cats) {
            assertTrue(tuple.get(catEntity) instanceof Cat);
View Full Code Here

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

    @Test
    @NoBatooJPA
    @NoEclipseLink
    public void EntityQueries6() {
        QCat catEntity = QCat.cat;
        List<CatDTO> results = query().from(cat).list(Projections.constructor(CatDTO.class, catEntity));
        assertEquals(6, results.size());

        for (CatDTO cat : results) {
            assertTrue(cat.cat instanceof Cat);
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.getResultList().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.getResultList().size());
    }
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.