mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-13 21:01:01 +08:00
Add test
This commit is contained in:
parent
3f4dd57bd5
commit
e4e75e86c9
@ -20,6 +20,7 @@ import java.sql.Connection;
|
||||
import org.easymock.EasyMock;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.Survey;
|
||||
import com.mysema.query.sql.dml.SQLDeleteClause;
|
||||
import com.mysema.query.sql.dml.SQLInsertClause;
|
||||
import com.mysema.query.sql.dml.SQLUpdateClause;
|
||||
@ -196,6 +197,19 @@ public class SerializationTest {
|
||||
"from dual", q.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void With_Tuple() {
|
||||
PathBuilder<Survey> survey = new PathBuilder<Survey>(Survey.class, "SURVEY");
|
||||
QSurvey survey2 = new QSurvey("survey2");
|
||||
SQLQuery q = new SQLQuery(SQLTemplates.DEFAULT);
|
||||
q.with(survey, survey.get(survey2.id), survey.get(survey2.name)).as(
|
||||
new SQLSubQuery().from(survey2).list(survey2.id, survey2.name));
|
||||
|
||||
assertEquals("with SURVEY (ID, NAME) as (select survey2.ID, survey2.NAME\n" +
|
||||
"from SURVEY survey2)\n\n" +
|
||||
"from dual", q.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void With_SingleColumn() {
|
||||
QSurvey survey2 = new QSurvey("survey2");
|
||||
@ -208,4 +222,6 @@ public class SerializationTest {
|
||||
"from dual", q.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user