Search in sources :

Example 31 with QSurvey

use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.

the class RelationalFunctionCallTest method validation.

@Test
public void validation() {
    QSurvey survey = QSurvey.survey;
    TokenizeFunction func = new TokenizeFunction("func", "a", "b");
    SQLQuery<?> sub = selectOne().from(func.as(func.alias)).where(survey.name.like(func.token));
    System.out.println(sub);
}
Also used : QSurvey(com.querydsl.sql.domain.QSurvey) Test(org.junit.Test)

Example 32 with QSurvey

use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.

the class RelationalPathTest method in_tuple.

@Test
public void in_tuple() throws ClassNotFoundException, IOException {
    //(survey.id, survey.name)
    QSurvey survey = QSurvey.survey;
    QTuple tuple = Projections.tuple(survey.id, survey.name);
    serialize(tuple);
    serialize(tuple.newInstance(1, "a"));
}
Also used : QTuple(com.querydsl.core.types.QTuple) QSurvey(com.querydsl.sql.domain.QSurvey) Test(org.junit.Test)

Example 33 with QSurvey

use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.

the class RelationalPathTest method path.

@Test
public void path() throws ClassNotFoundException, IOException {
    QSurvey survey = QSurvey.survey;
    QSurvey survey2 = serialize(survey);
    assertEquals(Arrays.asList(survey.all()), Arrays.asList(survey2.all()));
    assertEquals(survey.getMetadata(), survey2.getMetadata());
    assertEquals(survey.getMetadata(survey.id), survey2.getMetadata(survey.id));
}
Also used : QSurvey(com.querydsl.sql.domain.QSurvey) Test(org.junit.Test)

Example 34 with QSurvey

use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.

the class SQLServerQueryTest method tableHints_multiple2.

@Test
public void tableHints_multiple2() {
    QSurvey survey2 = new QSurvey("survey2");
    SQLServerQuery<?> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
    query.from(survey).tableHints(SQLServerTableHints.NOWAIT).from(survey2).tableHints(SQLServerTableHints.NOLOCK).where(survey.name.isNull());
    assertEquals("from SURVEY SURVEY with (NOWAIT), SURVEY survey2 with (NOLOCK)\nwhere SURVEY.NAME is null", query.toString());
}
Also used : SQLServerTemplates(com.querydsl.sql.SQLServerTemplates) QSurvey(com.querydsl.sql.domain.QSurvey) Test(org.junit.Test)

Aggregations

QSurvey (com.querydsl.sql.domain.QSurvey)34 Test (org.junit.Test)33 QEmployee (com.querydsl.sql.domain.QEmployee)10 SQLDeleteClause (com.querydsl.sql.dml.SQLDeleteClause)4 SQLUpdateClause (com.querydsl.sql.dml.SQLUpdateClause)4 SubQueryExpression (com.querydsl.core.types.SubQueryExpression)2 Param (com.querydsl.core.types.dsl.Param)2 BooleanBuilder (com.querydsl.core.BooleanBuilder)1 Tuple (com.querydsl.core.Tuple)1 IncludeIn (com.querydsl.core.testutil.IncludeIn)1 Path (com.querydsl.core.types.Path)1 QTuple (com.querydsl.core.types.QTuple)1 PathBuilder (com.querydsl.core.types.dsl.PathBuilder)1 SQLServerTemplates (com.querydsl.sql.SQLServerTemplates)1 Before (org.junit.Before)1 Ignore (org.junit.Ignore)1