Search in sources :

Example 21 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class JPASQLBase method entityQueries_createQuery2.

@Test
@ExcludeIn(Target.MYSQL)
public void entityQueries_createQuery2() {
    SAnimal cat = new SAnimal("CAT");
    QCat catEntity = QCat.cat;
    Query query = query().from(cat).select(catEntity).createQuery();
    assertEquals(6, query.getResultList().size());
}
Also used : SAnimal(com.querydsl.jpa.domain.sql.SAnimal) QCat(com.querydsl.jpa.domain.QCat) JPASQLQuery(com.querydsl.jpa.sql.JPASQLQuery) Query(javax.persistence.Query) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 22 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class AbstractJPATest method multiply_bigDecimal.

@Test
@ExcludeIn(ORACLE)
public void multiply_bigDecimal() {
    QSimpleTypes entity = new QSimpleTypes("entity1");
    QSimpleTypes entity2 = new QSimpleTypes("entity2");
    NumberPath<BigDecimal> bigd1 = entity.bigDecimal;
    NumberPath<BigDecimal> bigd2 = entity2.bigDecimal;
    assertEquals(Arrays.asList(), query().from(entity, entity2).where(bigd1.multiply(bigd2).loe(new BigDecimal("1.00"))).select(entity).fetch());
}
Also used : BigDecimal(java.math.BigDecimal) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 23 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class AbstractJPATest method subtract_bigDecimal.

@Test
@ExcludeIn(ORACLE)
public void subtract_bigDecimal() {
    QSimpleTypes entity = new QSimpleTypes("entity1");
    QSimpleTypes entity2 = new QSimpleTypes("entity2");
    NumberPath<BigDecimal> bigd1 = entity.bigDecimal;
    NumberPath<BigDecimal> bigd2 = entity2.bigDecimal;
    assertEquals(Arrays.asList(), query().from(entity, entity2).where(bigd1.subtract(bigd2).loe(new BigDecimal("1.00"))).select(entity).fetch());
}
Also used : BigDecimal(java.math.BigDecimal) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 24 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class AbstractJPATest method divide_bigDecimal.

@Test
@ExcludeIn(ORACLE)
public void divide_bigDecimal() {
    QSimpleTypes entity = new QSimpleTypes("entity1");
    QSimpleTypes entity2 = new QSimpleTypes("entity2");
    NumberPath<BigDecimal> bigd1 = entity.bigDecimal;
    NumberPath<BigDecimal> bigd2 = entity2.bigDecimal;
    assertEquals(Arrays.asList(), query().from(entity, entity2).where(bigd1.divide(bigd2).loe(new BigDecimal("1.00"))).select(entity).fetch());
    assertEquals(Arrays.asList(), query().from(entity, entity2).where(entity.ddouble.divide(bigd2).loe(new BigDecimal("1.00"))).select(entity).fetch());
    assertEquals(Arrays.asList(), query().from(entity, entity2).where(bigd1.divide(entity.ddouble).loe(new BigDecimal("1.00"))).select(entity).fetch());
}
Also used : BigDecimal(java.math.BigDecimal) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 25 with ExcludeIn

use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.

the class AbstractJPATest method transform_groupBy_alias.

@Test
@ExcludeIn(DERBY)
public void transform_groupBy_alias() {
    QCat kitten = new QCat("kitten");
    SimplePath<Cat> k = Expressions.path(Cat.class, "k");
    Map<Integer, Group> result = query().from(cat).innerJoin(cat.kittens, kitten).transform(GroupBy.groupBy(cat.id).as(cat.name, cat.id, GroupBy.list(Projections.constructor(Cat.class, kitten.name, kitten.id).as(k))));
    for (Group entry : result.values()) {
        assertNotNull(entry.getOne(cat.id));
        assertNotNull(entry.getOne(cat.name));
        assertFalse(entry.getList(k).isEmpty());
    }
}
Also used : BigInteger(java.math.BigInteger) Group(com.querydsl.core.group.Group) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Aggregations

ExcludeIn (com.querydsl.core.testutil.ExcludeIn)40 Test (org.junit.Test)38 Tuple (com.querydsl.core.Tuple)9 SQLInsertClause (com.querydsl.sql.dml.SQLInsertClause)6 ResultSet (java.sql.ResultSet)6 SAnimal (com.querydsl.jpa.domain.sql.SAnimal)4 QEmployee (com.querydsl.sql.domain.QEmployee)4 BigDecimal (java.math.BigDecimal)4 Date (java.sql.Date)4 Ignore (org.junit.Ignore)4 AbstractBaseTest (com.querydsl.sql.AbstractBaseTest)3 Group (com.querydsl.core.group.Group)2 IncludeIn (com.querydsl.core.testutil.IncludeIn)2 QCat (com.querydsl.jpa.domain.QCat)2 BigInteger (java.math.BigInteger)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 ImmutableList (com.google.common.collect.ImmutableList)1 MockTuple (com.querydsl.core.group.MockTuple)1 StringPath (com.querydsl.core.types.dsl.StringPath)1 QBookMark (com.querydsl.jpa.domain4.QBookMark)1