use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class SerializationTest method with_singleColumn.
@Test
public void with_singleColumn() {
QSurvey survey2 = new QSurvey("survey2");
SQLQuery<?> q = new SQLQuery<Void>();
q.with(survey, new Path<?>[] { survey.id }).as(select(survey2.id).from(survey2));
assertEquals("with SURVEY (ID) as (select survey2.ID\n" + "from SURVEY survey2)\n\n" + "from dual", q.toString());
}
use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class ListSubQueryTest method hashCode1.
@Test
public void hashCode1() {
QSurvey survey = QSurvey.survey;
QSurvey survey2 = new QSurvey("survey2");
SubQueryExpression<Tuple> query1 = select(survey.all()).from(survey);
SubQueryExpression<Tuple> query2 = select(survey2.all()).from(survey2);
Set<SubQueryExpression<Tuple>> queries = Sets.newHashSet();
queries.add(query1);
queries.add(query2);
assertEquals(2, queries.size());
}
use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class MergeBase method merge_with_keys_and_subQuery.
@Test
@IncludeIn(H2)
public void merge_with_keys_and_subQuery() {
assertEquals(1, insert(survey).set(survey.id, 6).set(survey.name, "H").execute());
// keys + subquery
QSurvey survey2 = new QSurvey("survey2");
assertEquals(2, merge(survey).keys(survey.id).select(query().from(survey2).select(survey2.id.add(1), survey2.name, survey2.name2)).execute());
}
use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class SQLSerializerTest method startsWith.
@Test
public void startsWith() {
SQLSerializer serializer = new SQLSerializer(Configuration.DEFAULT);
QSurvey s1 = new QSurvey("s1");
serializer.handle(s1.name.startsWith("X"));
assertEquals("s1.NAME like ? escape '\\'", serializer.toString());
assertEquals(Arrays.asList("X%"), serializer.getConstants());
}
use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class SQLSerializerTest method boolean_.
@Test
public void boolean_() {
QSurvey s = new QSurvey("s");
BooleanBuilder bb1 = new BooleanBuilder();
bb1.and(s.name.eq(s.name));
BooleanBuilder bb2 = new BooleanBuilder();
bb2.or(s.name.eq(s.name));
bb2.or(s.name.eq(s.name));
String str = new SQLSerializer(Configuration.DEFAULT).handle(bb1.and(bb2)).toString();
assertEquals("s.NAME = s.NAME and (s.NAME = s.NAME or s.NAME = s.NAME)", str);
}
Aggregations