Package com.mysema.query.sql

Examples of com.mysema.query.sql.SQLQuery


   
    private QSurvey survey = new QSurvey("survey");
   
    @Before
    public void setUp() {
        query = new SQLQuery(null, new H2Templates() {{
            newLineToSingleSpace();
        }});
    }
View Full Code Here


   
    private QSurvey survey = new QSurvey("survey");
   
    @Before
    public void setUp() {
        query = new SQLQuery(null, new H2Templates() {{
            newLineToSingleSpace();
        }});
    }
View Full Code Here

    @Test
    public void test() throws IOException, SecurityException,
            IllegalArgumentException, NoSuchMethodException,
            IllegalAccessException, InvocationTargetException {
        SQLQuery query = new SQLQuery(connection, new DerbyTemplates());
        query.from(survey);
        query.addListener(new TestLoggingListener());
        new QueryMutability(query).test(survey.id, survey.name);
    }
View Full Code Here

        new QueryMutability(query).test(survey.id, survey.name);
    }

    @Test
    public void Clone() {
        SQLQuery query = new SQLQuery(new DerbyTemplates()).from(survey);
        SQLQuery query2 = query.clone(connection);
        assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
        assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
        query2.list(survey.id);
    }
View Full Code Here

        Runner.run("qdsl by id", new Benchmark() {
            @Override
            public void run(int times) throws Exception {
                for (int i = 0; i < times; i++) {           
                    QCompanies companies = QCompanies.companies;
                    SQLQuery query = new SQLQuery(conn, conf);
                    query.from(companies).where(companies.id.eq((long)i))
                        .list(companies.name);           
                }               
            }           
        });   
    }
View Full Code Here

        Runner.run("qdsl by id (iterated)", new Benchmark() {
            @Override
            public void run(int times) throws Exception {
                for (int i = 0; i < times; i++) {           
                    QCompanies companies = QCompanies.companies;
                    SQLQuery query = new SQLQuery(conn, conf);
                    CloseableIterator<String> it = query.from(companies)
                            .where(companies.id.eq((long)i)).iterate(companies.name);
                    try {
                        while (it.hasNext()) {
                            it.next();
                        }   
View Full Code Here

        Runner.run("qdsl by id (result set access)", new Benchmark() {
            @Override
            public void run(int times) throws Exception {
                for (int i = 0; i < times; i++) {           
                    QCompanies companies = QCompanies.companies;
                    SQLQuery query = new SQLQuery(conn, conf);
                    ResultSet rs = query.from(companies)
                            .where(companies.id.eq((long)i)).getResults(companies.name);         
                    try {
                        while (rs.next()) {
                            rs.getString(1);
                        }
View Full Code Here

        Runner.run("qdsl by id (no validation)", new Benchmark() {
            @Override
            public void run(int times) throws Exception {
                for (int i = 0; i < times; i++) {           
                    QCompanies companies = QCompanies.companies;
                    SQLQuery query = new SQLQuery(conn, conf, new DefaultQueryMetadata().noValidate());
                    query.from(companies).where(companies.id.eq((long)i))
                        .list(companies.name);           
                }               
            }           
        });   
    }
View Full Code Here

        Runner.run("qdsl by id (two cols)", new Benchmark() {
            @Override
            public void run(int times) throws Exception {
                for (int i = 0; i < times; i++) {
                    QCompanies companies = QCompanies.companies;
                    SQLQuery query = new SQLQuery(conn, conf);
                    query.from(companies).where(companies.id.eq((long)i))
                        .list(companies.id, companies.name);           
                }               
            }           
        });           
    }
View Full Code Here

        Runner.run("qdsl by name", new Benchmark() {
            @Override
            public void run(int times) throws Exception {
                for (int i = 0; i < times; i++) {           
                    QCompanies companies = QCompanies.companies;
                    SQLQuery query = new SQLQuery(conn, conf);
                    query.from(companies).where(companies.name.eq(String.valueOf(i)))
                        .list(companies.name);           
                }               
            }           
        });   
    }
View Full Code Here

TOP

Related Classes of com.mysema.query.sql.SQLQuery

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.