Search in sources :

Example 36 with ExcludeIn

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

the class InsertBase method insert_nulls_in_batch2.

@Test
@Ignore
@ExcludeIn({ DERBY })
public void insert_nulls_in_batch2() {
    Mapper<Object> mapper = DefaultMapper.WITH_NULL_BINDINGS;
    //        QFoo f= QFoo.foo;
    //        SQLInsertClause sic = new SQLInsertClause(c, new H2Templates(), f);
    //        Foo f1=new Foo();
    //        sic.populate(f1).addBatch();
    //        f1=new Foo();
    //        f1.setC1(1);
    //        sic.populate(f1).addBatch();
    //        sic.execute();
    QEmployee employee = QEmployee.employee;
    SQLInsertClause sic = insert(employee);
    Employee e = new Employee();
    sic.populate(e, mapper).addBatch();
    e = new Employee();
    e.setFirstname("X");
    sic.populate(e, mapper).addBatch();
    assertEquals(0, sic.execute());
}
Also used : SQLInsertClause(com.querydsl.sql.dml.SQLInsertClause) Ignore(org.junit.Ignore) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 37 with ExcludeIn

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

the class InsertBase method insert_with_keys.

@Test
@ExcludeIn({ CUBRID, SQLSERVER })
public void insert_with_keys() throws SQLException {
    ResultSet rs = insert(survey).set(survey.name, "Hello World").executeWithKeys();
    assertTrue(rs.next());
    assertTrue(rs.getObject(1) != null);
    rs.close();
}
Also used : ResultSet(java.sql.ResultSet) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 38 with ExcludeIn

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

the class InsertBase method insert_nulls_in_batch.

@Test
@ExcludeIn(ORACLE)
public void insert_nulls_in_batch() {
    //        QFoo f= QFoo.foo;
    //        SQLInsertClause sic = new SQLInsertClause(c, new H2Templates(), f);
    //        sic.columns(f.c1,f.c2).values(null,null).addBatch();
    //        sic.columns(f.c1,f.c2).values(null,1).addBatch();
    //        sic.execute();
    SQLInsertClause sic = insert(survey);
    sic.columns(survey.name, survey.name2).values(null, null).addBatch();
    sic.columns(survey.name, survey.name2).values(null, "X").addBatch();
    assertEquals(2, sic.execute());
}
Also used : SQLInsertClause(com.querydsl.sql.dml.SQLInsertClause) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 39 with ExcludeIn

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

the class InsertBase method insertBatch_with_subquery.

@Test
// too slow
@ExcludeIn(FIREBIRD)
public void insertBatch_with_subquery() {
    SQLInsertClause insert = insert(survey).columns(survey.id, survey.name).select(query().from(survey2).select(survey2.id.add(20), survey2.name)).addBatch();
    insert(survey).columns(survey.id, survey.name).select(query().from(survey2).select(survey2.id.add(40), survey2.name)).addBatch();
    assertEquals(1, insert.execute());
}
Also used : SQLInsertClause(com.querydsl.sql.dml.SQLInsertClause) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 40 with ExcludeIn

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

the class UpdateBase method setNullEmptyRootPath.

@Test
@SkipForQuoted
@ExcludeIn({ DERBY })
public void setNullEmptyRootPath() {
    StringPath name = Expressions.stringPath("name");
    long count = query().from(survey).fetchCount();
    assertEquals(count, execute(update(survey).setNull(name)));
}
Also used : StringPath(com.querydsl.core.types.dsl.StringPath) 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