assertEquals("abc", instance.singleResult());
}
@Test
public void testGetQueryString() {
EqCriterion criterion1 = new EqCriterion("name", "abc");
InCriterion criterion2 = new InCriterion("age", Arrays.asList(1, 2));
instance.eq("name", "abc")
.isEmpty("post")
.notNull("birthday")
.in("age", Arrays.asList(1, 2))
.getQueryString();
assertEquals("select distinct(rootEntity) from org.dayatang.domain.entity.MyEntity as rootEntity "
+ "where rootEntity.name = :rootEntity_name" + criterion1.hashCode() + " "
+ "and rootEntity.post is empty "
+ "and rootEntity.birthday is not null "
+ "and rootEntity.age in :rootEntity_age" + criterion2.hashCode(),
instance.getQueryString());
assertEquals(NamedParameters.create()
.add("rootEntity_name" + criterion1.hashCode(), "abc")
.add("rootEntity_age" + criterion2.hashCode(), Arrays.asList(1, 2)),
instance.getParameters());
}