use of com.querydsl.core.types.dsl.Param in project querydsl by querydsl.
the class DefaultQueryMetadataTest method setParam.
@SuppressWarnings("unchecked")
@Test
public void setParam() {
metadata.setParam(new Param(String.class, "str"), ConstantImpl.create("X"));
assertEquals(1, metadata.getParams().size());
assertTrue(metadata.getParams().get(new Param(String.class, "str")).equals(ConstantImpl.create("X")));
}
use of com.querydsl.core.types.dsl.Param in project querydsl by querydsl.
the class LuceneQueryTest method uniqueResult_with_param.
@Test
public void uniqueResult_with_param() {
final Param<String> param = new Param<String>(String.class, "title");
query.set(param, "Nummi");
query.where(title.startsWith(param));
final Document document = query.fetchOne();
assertEquals("Nummisuutarit", document.get("title"));
}
use of com.querydsl.core.types.dsl.Param in project querydsl by querydsl.
the class DeleteBase method delete_with_subQuery_exists_Params.
@Test
public void delete_with_subQuery_exists_Params() {
QSurvey survey1 = new QSurvey("s1");
QEmployee employee = new QEmployee("e");
Param<Integer> param = new Param<Integer>(Integer.class, "param");
SQLQuery<?> sq = query().from(employee).where(employee.id.eq(param));
sq.set(param, -12478923);
SQLDeleteClause delete = delete(survey1);
delete.where(survey1.name.eq("XXX"), sq.exists());
assertEquals(0, delete.execute());
}
use of com.querydsl.core.types.dsl.Param in project querydsl by querydsl.
the class UpdateBase method update_with_subQuery_exists_Params.
@Test
public void update_with_subQuery_exists_Params() {
QSurvey survey1 = new QSurvey("s1");
QEmployee employee = new QEmployee("e");
Param<Integer> param = new Param<Integer>(Integer.class, "param");
SQLQuery<?> sq = query().from(employee).where(employee.id.eq(param));
sq.set(param, -12478923);
SQLUpdateClause update = update(survey1);
update.set(survey1.name, "AA");
update.where(sq.exists());
assertEquals(0, update.execute());
}
use of com.querydsl.core.types.dsl.Param in project querydsl by querydsl.
the class LuceneQueryTest method uniqueResult_with_param.
@Test
public void uniqueResult_with_param() {
final Param<String> param = new Param<String>(String.class, "title");
query.set(param, "Nummi");
query.where(title.startsWith(param));
final Document document = query.fetchOne();
assertEquals("Nummisuutarit", document.get("title"));
}
Aggregations