Package com.mysema.query.sql.domain

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


        return new SQLSubQuery();
    }

    @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));
View Full Code Here


   
    private SQLQuery query;
   
    @Before
    public void setUp() {
        s1 = new QSurvey("s");
        s2 = new QSurvey("s2");   
        s3 = new QSurvey("s3");   
        s4 = new QSurvey("s4");   
        s5 = new QSurvey("s5");
        s6 = new QSurvey("s6");       
        query = new SQLQuery(connection,SQLTemplates.DEFAULT);
        query.from(s1);   
    }
View Full Code Here

    @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(
                sq().from(survey2).list(survey2.id.add(1), survey2.name, survey2.name2)).execute());
    }
View Full Code Here

        assertEquals(2, delete(survey).limit(2).execute());
    }

    @Test
    public void Delete_with_SubQuery_exists() {
        QSurvey survey1 = new QSurvey("s1");
        QEmployee employee = new QEmployee("e");
        SQLDeleteClause delete = delete(survey1);
        delete.where(survey1.name.eq("XXX"),
                sq().from(employee).where(survey1.id.eq(employee.id)).exists());
        delete.execute();
View Full Code Here

        delete.execute();
    }

    @Test
    public void Delete_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

        delete.execute();
    }

    @Test
    public void Delete_with_SubQuery_exists2() {
        QSurvey survey1 = new QSurvey("s1");
        QEmployee employee = new QEmployee("e");
        SQLDeleteClause delete = delete(survey1);
        delete.where(survey1.name.eq("XXX"),
                sq().from(employee).where(survey1.name.eq(employee.lastname)).exists());
        delete.execute();
View Full Code Here

public class ListSubQueryTest {

    @Test
    public void HashCode() {
        QSurvey survey = QSurvey.survey;
        QSurvey survey2 = new QSurvey("survey2");
        ListSubQuery<Tuple> query1 = new SQLSubQuery().from(survey).list(survey.all());
        ListSubQuery<Tuple> query2 = new SQLSubQuery().from(survey2).list(survey2.all());


        Set<ListSubQuery<Tuple>> queries = new HashSet<ListSubQuery<Tuple>>();
        queries.add(query1);
        queries.add(query2);
View Full Code Here

        assertEquals(2, queries.size());
    }
   
    @Test
    public void HashCode2() {
        QSurvey survey = new QSurvey("entity");
        QEmployee employee = new QEmployee("entity");
        ListSubQuery<Integer> query1 = new SQLSubQuery().from(survey).list(survey.id);
        ListSubQuery<Integer> query2 = new SQLSubQuery().from(employee).list(employee.id);

        Set<ListSubQuery<Integer>> queries = new HashSet<ListSubQuery<Integer>>();
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");
        SQLServerSubQuery query = new SQLServerSubQuery();
        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

    }

    @Test
    public void Complex() {
        // related to #584795
        QSurvey survey = new QSurvey("survey");
        QEmployee emp1 = new QEmployee("emp1");
        QEmployee emp2 = new QEmployee("emp2");
        SubQueryExpression<?> subQuery = new SQLSubQuery().from(survey)
          .innerJoin(emp1)
           .on(survey.id.eq(emp1.id))
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.