Package com.mysema.query.sql.h2

Source Code of com.mysema.query.sql.h2.H2QueryTest

package com.mysema.query.sql.h2;

import org.junit.Before;
import org.junit.Test;

import com.mysema.query.sql.H2Templates;
import com.mysema.query.sql.SQLQuery;
import com.mysema.query.sql.domain.QSurvey;

public class H2QueryTest {
   
    private SQLQuery query;
   
    private QSurvey survey = new QSurvey("survey");
   
    @Before
    public void setUp() {
        query = new SQLQuery(null, new H2Templates() {{
            newLineToSingleSpace();
        }});
    }
   
    @Test
    public void Syntax() {
//        SELECT TOP? [DISTINCT | All]? selectExpression
//        FROM tableExpression+
        query.from(survey);
//        WHERE expression+
        query.where(survey.name.isNotNull());
//        GROUP BY expression+
        query.groupBy(survey.name);
//        HAVING expression
        query.having(survey.name.lt(""));
//        [
//          UNION ALL?  select ORDER BY order
//          MINUS
//          EXCEPT
//          INTERSECT
//        ]
//        LIMIT expression
        query.limit(2);
//        OFFSET expression
        query.offset(3);
//        SAMPLE_SIZE rowCountInt
        // TODO
//        FOR UPDATE
        query.forUpdate();
    }

}
TOP

Related Classes of com.mysema.query.sql.h2.H2QueryTest

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.