Examples of QCat


Examples of com.mysema.query.domain.QCat

                "  inner join treat(cat.mate as DomesticCat) as domesticCat", serializer.toString());
    }

    @Test
    public void OpenJPA_Variables() {
        QCat cat = QCat.cat;
        JPQLSerializer serializer = new JPQLSerializer(OpenJPATemplates.DEFAULT);
        QueryMetadata md = new DefaultQueryMetadata();
        md.addJoin(JoinType.DEFAULT, cat);
        md.addJoin(JoinType.INNERJOIN, cat.mate);
        md.addJoinCondition(cat.mate.alive);
View Full Code Here

Examples of com.mysema.query.domain.QCat

                sub().from(cat).list(cat.name).count());
    }

    @Test
    public void Count_Multiple_Sources() {
        QCat other = new QCat("other");
        assertToString("(select count(cat, other) from Cat cat, Cat other)",    
                sub().from(cat, other).count());
    }
View Full Code Here

Examples of com.mysema.query.domain.QCat

                sub().from(cat, other).count());
    }
   
    @Test
    public void Count_Multiple_Sources_Via_List() {
        QCat other = new QCat("other");
        assertToString("(select count(cat, other) from Cat cat, Cat other)",     
                sub().from(cat, other).list(cat, other).count());
    }
View Full Code Here

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

//        assertEquals("inheritedProperties", superClass.toString());
//    }

    @Test
    public void SubClassToSuper() {
        QCat cat = QCat.cat;
        QAnimal animal = new QAnimal(cat);

        assertEquals(Cat.class, animal.getType());
//        assertEquals(Cat.class.getSimpleName(), animal.getEntityName());
        assertEquals("cat", animal.toString());
View Full Code Here

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

        assertEquals("cat", animal.toString());
    }

    @Test
    public void SubClassToSuper2() {
        QCat cat = QCat.cat;
        QAnimal animal = new QAnimal(cat.getMetadata());

        assertEquals(Animal.class, animal.getType());
//        assertEquals(Animal.class.getSimpleName(), animal.getEntityName());
        assertEquals("cat", animal.toString());
    }
View Full Code Here

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

    }

    @Test
    public void SuperClassToSub() {
        QAnimal animal = QAnimal.animal;
        QCat cat = new QCat(animal.getMetadata());

        assertEquals(Cat.class, cat.getType());
//        assertEquals(Cat.class.getSimpleName(), cat.getEntityName());
        assertEquals("animal", cat.toString());
    }
View Full Code Here

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

public class HibernateQueryTest {

    @Test
    public void Clone() {
        QCat cat = QCat.cat;
        BooleanBuilder emptyBooleanBuilder = new BooleanBuilder();
        HibernateQuery hq = new HibernateQuery().from(cat).where(cat.name.isNull().and(emptyBooleanBuilder));

        HibernateQuery hq2 = hq.clone();
        assertNotNull(hq2);
View Full Code Here

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

public class JPASubQueryTest {

    @Test
    public void Multiple_Projections() {
        QCat cat = QCat.cat;
        JPASubQuery query = new JPASubQuery();
        query.from(cat);
        assertEquals(1, query.list(cat).getMetadata().getProjection().size());
        assertEquals(1, query.list(cat).getMetadata().getProjection().size());
    }
View Full Code Here

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

        assertEquals(1, query.list(cat).getMetadata().getProjection().size());
    }

    @Test
    public void Via_Interface() {
        QCat cat = QCat.cat;
        JPQLSubQuery query = new JPASubQuery();
        query.from(cat);
        assertEquals(1, query.list(cat).getMetadata().getProjection().size());
        assertEquals(1, query.list(cat).getMetadata().getProjection().size());
    }
View Full Code Here

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

        mixin.where((Predicate)null);
    }

    @Test
    public void OrderBy() {
        QCat cat = QCat.cat;
        QCat cat_mate = new QCat("cat_mate");
        mixin.from(cat);
        mixin.orderBy(cat.mate.name.asc());

        QueryMetadata md = mixin.getMetadata();
        assertEquals(Arrays.asList(
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.