Package com.mysema.query.sql

Examples of com.mysema.query.sql.MySQLTemplates


public class NativeSQLSerializerTest {

    @Test
    public void In() {
        Configuration conf = new Configuration(new MySQLTemplates());
        NativeSQLSerializer serializer = new NativeSQLSerializer(conf, true);
        DefaultQueryMetadata md = new DefaultQueryMetadata();
        SAnimal cat = SAnimal.animal_;
        md.addJoin(JoinType.DEFAULT, cat);
        md.addWhere(cat.name.in("X", "Y"));
View Full Code Here


    private static final String SQL_BIG_RESULT = "sql_big_result ";

    private static final Joiner JOINER = Joiner.on(", ");

    public MySQLQuery(Connection conn) {
        this(conn, new Configuration(new MySQLTemplates()), new DefaultQueryMetadata());
    }
View Full Code Here

    public MySQLQueryFactory(Configuration configuration, Provider<Connection> connection) {
        super(configuration, connection);
    }

    public MySQLQueryFactory(Provider<Connection> connection) {
        this(new Configuration(new MySQLTemplates()), connection);
    }
View Full Code Here

    private QSurvey survey = new QSurvey("survey");

    @Before
    public void setUp() {
        query = new MySQLQuery(null, new MySQLTemplates() {{
            newLineToSingleSpace();
        }});
        query.from(survey);
        query.orderBy(survey.name.asc());
        query.getMetadata().addProjection(survey.name);
View Full Code Here

        query.lockInShareMode();
    }

    @Test
    public void ForceIndex() {
        query = new MySQLQuery(null, new MySQLTemplates() {{
            newLineToSingleSpace();
        }});
        query.from(survey);
        query.forceIndex("col1_index");
        query.orderBy(survey.name.asc());
View Full Code Here

                     "order by survey.NAME asc", toString(query));
    }

    @Test
    public void IgnoreIndex() {
        query = new MySQLQuery(null, new MySQLTemplates() {{
            newLineToSingleSpace();
        }});
        query.from(survey);
        query.ignoreIndex("col1_index");
        query.orderBy(survey.name.asc());
View Full Code Here

                     "order by survey.NAME asc", toString(query));
    }

    @Test
    public void UseIndex() {
        query = new MySQLQuery(null, new MySQLTemplates() {{
            newLineToSingleSpace();
        }});
        query.from(survey);
        query.useIndex("col1_index");
        query.orderBy(survey.name.asc());
View Full Code Here

                     "order by survey.NAME asc", toString(query));
    }

    @Test
    public void UseIndex2() {
        query = new MySQLQuery(null, new MySQLTemplates() {{
            newLineToSingleSpace();
        }});
        query.from(survey);
        query.useIndex("col1_index","col2_index");
        query.orderBy(survey.name.asc());
View Full Code Here

        case CUBRID:return new CUBRIDTemplates();
        case DERBY: return new DerbyTemplates();
        case H2:    return new H2Templates();
        case HSQLDB:return new HSQLDBTemplates();
        case SQLSERVER: return new SQLServerTemplates();
        case MYSQL: return new MySQLTemplates();
        case ORACLE:return new OracleTemplates();
        case POSTGRES: return new PostgresTemplates();
        case SQLITE:return new SQLiteTemplates();
        case TERADATA: return new TeradataTemplates();
        }
View Full Code Here

TOP

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

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.