Package org.apache.metamodel.jdbc.dialects

Examples of org.apache.metamodel.jdbc.dialects.MysqlQueryRewriter


            closeIfNescesary(con);
        }
        _databaseProductName = databaseProductName;
        logger.debug("Database product name: {}", _databaseProductName);
        if (DATABASE_PRODUCT_MYSQL.equals(_databaseProductName)) {
            setQueryRewriter(new MysqlQueryRewriter(this));
        } else if (DATABASE_PRODUCT_POSTGRESQL.equals(_databaseProductName)) {
            setQueryRewriter(new PostgresqlQueryRewriter(this));
        } else if (DATABASE_PRODUCT_SQLSERVER.equals(_databaseProductName)) {
            setQueryRewriter(new SQLServerQueryRewriter(this));
        } else if (DATABASE_PRODUCT_DB2.equals(_databaseProductName)
View Full Code Here


public class MysqlQueryRewriterTest extends TestCase {

  public void testRewriteLimit() throws Exception {
    Query q = new Query().from(new MutableTable("foo"))
        .select(new MutableColumn("bar")).setMaxRows(25).setFirstRow(6);
    String queryString = new MysqlQueryRewriter(null).rewriteQuery(q);
    assertEquals("SELECT bar FROM foo LIMIT 25 OFFSET 5", queryString);
  }
View Full Code Here

  public void testRewriteFilterOperandQuote() throws Exception {
    MutableColumn col = new MutableColumn("bar");
    Query q = new Query().from(new MutableTable("foo")).select(col)
        .where(col, OperatorType.EQUALS_TO, "M'jellow strain'ger");
    String queryString = new MysqlQueryRewriter(null).rewriteQuery(q);
    assertEquals("SELECT bar FROM foo WHERE bar = 'M\\'jellow strain\\'ger'",
        queryString);
  }
View Full Code Here

            closeIfNescesary(con);
        }
        _databaseProductName = databaseProductName;
        logger.debug("Database product name: {}", _databaseProductName);
        if (DATABASE_PRODUCT_MYSQL.equals(_databaseProductName)) {
            setQueryRewriter(new MysqlQueryRewriter(this));
        } else if (DATABASE_PRODUCT_POSTGRESQL.equals(_databaseProductName)) {
            setQueryRewriter(new PostgresqlQueryRewriter(this));
        } else if (DATABASE_PRODUCT_SQLSERVER.equals(_databaseProductName)) {
            setQueryRewriter(new SQLServerQueryRewriter(this));
        } else if (DATABASE_PRODUCT_DB2.equals(_databaseProductName)
View Full Code Here

            closeIfNescesary(con);
        }
        _databaseProductName = databaseProductName;
        logger.debug("Database product name: {}", _databaseProductName);
        if (DATABASE_PRODUCT_MYSQL.equals(_databaseProductName)) {
            setQueryRewriter(new MysqlQueryRewriter(this));
        } else if (DATABASE_PRODUCT_POSTGRESQL.equals(_databaseProductName)) {
            setQueryRewriter(new PostgresqlQueryRewriter(this));
        } else if (DATABASE_PRODUCT_SQLSERVER.equals(_databaseProductName)) {
            setQueryRewriter(new SQLServerQueryRewriter(this));
        } else if (DATABASE_PRODUCT_DB2.equals(_databaseProductName)
View Full Code Here

TOP

Related Classes of org.apache.metamodel.jdbc.dialects.MysqlQueryRewriter

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.