Package com.mysema.query.sql.domain

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


    }

    @Test
    public void Validate() {
        NumberPath<Long> operatorTotalPermits = new NumberPath<Long>(Long.class, "operator_total_permits");
        QSurvey survey = new QSurvey("survey");

        // select survey.name, count(*) as operator_total_permits
        // from survey
        // where survey.name >= "A"
        // group by survey.name
View Full Code Here


        new SQLSubQuery().union(q1);
    }

    @Test
    public void Union_With() {
        QSurvey survey1 = new QSurvey("survey1");
        QSurvey survey2 = new QSurvey("survey2");
        QSurvey survey3 = new QSurvey("survey3");

        SQLQuery query = new SQLQuery(SQLTemplates.DEFAULT);
        query.with(survey1, new SQLSubQuery().from(survey1).list(survey1.all()));
        query.union(
              new SQLSubQuery().from(survey2).list(survey2.all()),
              new SQLSubQuery().from(survey3).list(survey3.all()));

        assertEquals("with survey1 as (select survey1.NAME, survey1.NAME2, survey1.ID\n" +
                "from SURVEY survey1)\n" +
                "(select survey2.NAME, survey2.NAME2, survey2.ID\n" +
                "from SURVEY survey2)\n" +
View Full Code Here

        assertEquals("from SURVEY SURVEY with (NOWAIT, NOLOCK)\nwhere SURVEY.NAME is null", query.toString());
    }
   
    @Test
    public void TableHints_Multiple2() {
        QSurvey survey2 = new QSurvey("survey2");
        SQLServerQuery query = new SQLServerQuery(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());
View Full Code Here

TOP

Related Classes of com.mysema.query.sql.domain.QSurvey

Copyright © 2018 www.massapicom. 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.