Examples of QSurvey


Examples of com.mysema.query.sql.domain.QSurvey

    }

    @Test
    public void In_Tuple() throws ClassNotFoundException, IOException {
        //(survey.id, survey.name)
        QSurvey survey = QSurvey.survey;
        QTuple tuple = new QTuple(survey.id, survey.name);
        serialize(tuple);
        serialize(tuple.newInstance(1, "a"));
    }
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

public class JoinUsageTest {
   
    @Test(expected=IllegalStateException.class)
    public void Join_Already_Declared() {
        QSurvey survey = QSurvey.survey;
        SQLSubQuery subQuery = new SQLSubQuery(new DefaultQueryMetadata());
        subQuery.from(survey).fullJoin(survey);
    }
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

   
    int iterations;
   
    @Before
    public void setUp() {
        QSurvey survey = QSurvey.survey;
        md = new DefaultQueryMetadata();
        md.addJoin(JoinType.DEFAULT, survey);
        md.addWhere(survey.id.eq(10));
        md.addProjection(survey.name);
       
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

       
    }
   
    @Test
    public void Validation() {
        QSurvey survey = QSurvey.survey;
        TokenizeFunction func = new TokenizeFunction("func", "a", "b");
        SQLSubQuery sub = new SQLSubQuery().from(func.as(func.alias)).where(survey.name.like(func.token));
        System.out.println(sub);
       
    }
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

        query.cache();
        query.noCache();
        query.calcFoundRows();
//        select_expr [, select_expr ...]
//        [FROM table_references
        query.from(new QSurvey("survey2"));
//        [WHERE where_condition]
        query.where(survey.id.isNotNull());
//        [GROUP BY {col_name | expr | position}
        query.groupBy(survey.name);
//          [ASC | DESC], ... [WITH ROLLUP]]
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

        assertEquals(2, update.execute());
    }

    @Test
    public void Update_with_SubQuery_exists() {
        QSurvey survey1 = new QSurvey("s1");
        QEmployee employee = new QEmployee("e");
        SQLUpdateClause update = update(survey1);
        update.set(survey1.name, "AA");
        update.where(new SQLSubQuery().from(employee).where(survey1.id.eq(employee.id)).exists());
        update.execute();
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

        update.execute();
    }

    @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");
        SQLSubQuery sq = sq().from(employee).where(employee.id.eq(param));
        sq.set(param, -12478923);
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

        update.execute();
    }

    @Test
    public void Update_with_SubQuery_exists2() {
        QSurvey survey1 = new QSurvey("s1");
        QEmployee employee = new QEmployee("e");
        SQLUpdateClause update = update(survey1);
        update.set(survey1.name, "AA");
        update.where(new SQLSubQuery().from(employee).where(survey1.name.eq(employee.lastname)).exists());
        update.execute();
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

        update.execute();
    }

    @Test
    public void Update_with_SubQuery_notExists() {
        QSurvey survey1 = new QSurvey("s1");
        QEmployee employee = new QEmployee("e");
        SQLUpdateClause update = update(survey1);
        update.set(survey1.name, "AA");
        update.where(sq().from(employee).where(survey1.id.eq(employee.id)).notExists());
        update.execute();
View Full Code Here

Examples of com.mysema.query.sql.domain.QSurvey

    }

    @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());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.