Examples of Dialect


Examples of com.clarkparsia.empire.Dialect

      if (aURI != null) {
        aNG = aURI.toString();
      }
    }

    Dialect aDialect = theSource.getQueryFactory().getDialect();

    String aSPARQL = "select distinct ?s\n" +
             (aNG == null ? "" : "from <" + aNG + ">\n") +
             "where {?s ?p ?o. filter(?s = " + aDialect.asQueryString(EmpireUtil.asResource(EmpireUtil.asSupportsRdfId(theObj))) + ") } limit 1";

    String aSeRQL = "select distinct s\n" +
             (aNG == null ? "from\n" : "from context <" + aNG + ">\n") +
             "{s} p {o} where s = " + aDialect.asQueryString(EmpireUtil.asResource(EmpireUtil.asSupportsRdfId(theObj))) + " limit 1";

    ResultSet aResults;

    if (theSource.getQueryFactory().getDialect() instanceof SerqlDialect) {
      aResults = theSource.selectQuery(aSeRQL);
View Full Code Here

Examples of com.github.miemiedev.mybatis.paginator.dialect.Dialect

                && pageBounds.getLimit() == RowBounds.NO_ROW_LIMIT
                && pageBounds.getOrders().isEmpty()){
            return invocation.proceed();
        }

        final Dialect dialect;
        try {
            Class clazz = Class.forName(dialectClass);
            Constructor constructor = clazz.getConstructor(MappedStatement.class, Object.class, PageBounds.class);
            dialect = (Dialect)constructor.newInstance(new Object[]{ms, parameter, pageBounds});
        } catch (Exception e) {
            throw new ClassNotFoundException("Cannot create dialect instance: "+dialectClass,e);
        }

        final BoundSql boundSql = ms.getBoundSql(parameter);

        queryArgs[MAPPED_STATEMENT_INDEX] = copyFromNewSql(ms,boundSql,dialect.getPageSQL(), dialect.getParameterMappings(), dialect.getParameterObject());
        queryArgs[PARAMETER_INDEX] = dialect.getParameterObject();
        queryArgs[ROWBOUNDS_INDEX] = new RowBounds(RowBounds.NO_ROW_OFFSET,RowBounds.NO_ROW_LIMIT);

        Boolean async = pageBounds.getAsyncTotalCount() == null ? asyncTotalCount : pageBounds.getAsyncTotalCount();
        Future<List> listFuture = call(new Callable<List>() {
            public List call() throws Exception {
                return (List)invocation.proceed();
            }
        }, async);


        if(pageBounds.isContainsTotalCount()){
            Callable<Paginator> countTask = new Callable() {
                public Object call() throws Exception {
                    Integer count;
                    Cache cache = ms.getCache();
                    if(cache != null && ms.isUseCache() && ms.getConfiguration().isCacheEnabled()){
                        CacheKey cacheKey = executor.createCacheKey(ms,parameter,new PageBounds(),copyFromBoundSql(ms,boundSql,dialect.getCountSQL(), boundSql.getParameterMappings(), boundSql.getParameterObject()));
                        count = (Integer)cache.getObject(cacheKey);
                        if(count == null){
                            count = SQLHelp.getCount(ms,parameter,boundSql,dialect);
                            cache.putObject(cacheKey, count);
                        }
View Full Code Here

Examples of com.google.gwt.requestfactory.shared.impl.AbstractRequestContext.Dialect

        }
      }

      Class<? extends RequestContext> context = method.getReturnType().asSubclass(
          RequestContext.class);
      Dialect dialect = method.getReturnType().isAnnotationPresent(
          JsonRpcService.class) ? Dialect.JSON_RPC : Dialect.STANDARD;
      RequestContextHandler handler = new InProcessRequestContext(
          InProcessRequestFactory.this, dialect).new RequestContextHandler();
      return context.cast(Proxy.newProxyInstance(
          Thread.currentThread().getContextClassLoader(),
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.Dialect

        }
      }

      Class<? extends RequestContext> context = method.getReturnType().asSubclass(
          RequestContext.class);
      Dialect dialect = method.getReturnType().isAnnotationPresent(
          JsonRpcService.class) ? Dialect.JSON_RPC : Dialect.STANDARD;
      RequestContextHandler handler = new InProcessRequestContext(
          InProcessRequestFactory.this, dialect).new RequestContextHandler();
      return context.cast(Proxy.newProxyInstance(
          Thread.currentThread().getContextClassLoader(),
View Full Code Here

Examples of com.thinkgem.jeesite.common.persistence.dialect.Dialect

     * <ode>dbms</ode> 数据库类型,插件支持的数据库
     * <code>sqlPattern</code> 需要拦截的SQL ID
     * @param p 属性
     */
    protected void initProperties(Properties p) {
      Dialect dialect = null;
        String dbType = Global.getConfig("jdbc.type");
        if ("db2".equals(dbType)){
          dialect = new DB2Dialect();
        }else if("derby".equals(dbType)){
          dialect = new DerbyDialect();
View Full Code Here

Examples of de.mhus.lib.sql.Dialect

     
      cdb.setConfig("connection", ccon);
     
      cconfig.setConfig("test", cdb);
      DbPoolBundle pool = new DbPoolBundle(cconfig,null);
      Dialect dialect = pool.getPool("test").getDialect();
     
      NodeConfig cqueries = new NodeConfig();
      cqueries.setProperty("create", "create table test (a_text varchar(100))");
      cqueries.setProperty("select", "select * from test");
      cqueries.setProperty("cleanup", "delete from test");
      cqueries.setProperty("insert", "insert into test (a_text) values ($text,text$)");
      cqueries.setProperty("dropblub", "drop table if exists blub_");

      cqueries.setProperty("create2", "create table test2 ("+
          " a_text "   +dialect.getDbType(Dialect.TYPE.STRING.name(), "100") +
          ",a_date "   +dialect.getDbType(Dialect.TYPE.DATETIME.name(), null) +
          ",a_int "    +dialect.getDbType(Dialect.TYPE.INT.name(), null) +
          ",a_bool "   +dialect.getDbType(Dialect.TYPE.BOOL.name(), null) +
          ",a_blob "   +dialect.getDbType(Dialect.TYPE.BLOB.name(), null) +
          ",a_float "  +dialect.getDbType(Dialect.TYPE.FLOAT.name(), null) +
          ",a_double " +dialect.getDbType(Dialect.TYPE.DOUBLE.name(), null) +
          ",a_long "   +dialect.getDbType(Dialect.TYPE.LONG.name(), null) +
          ")");
      cqueries.setProperty("insert2", "insert into test2 (a_text,a_date,a_int,a_bool,a_blob,a_float,a_double,a_long) values ($text$,$date$,$int$,$bool$,$blob$,$float$,$double$,$long$)");
      cqueries.setProperty("cleanup2", "delete from test2");

      cdb.setConfig("queries", cqueries);
View Full Code Here

Examples of fi.evident.dalesbred.dialects.Dialect

*/
public abstract class DalesbredConfigurationSupport {

    @Bean
    public Database dalesbredDatabase(DataSource dataSource, PlatformTransactionManager transactionManager) {
        Dialect dialect = dialect();
        if (dialect == null)
            dialect = Dialect.detect(dataSource);

        Database db = new Database(new SpringTransactionManager(dataSource, transactionManager), dialect);
        registerInstantiators(db.getInstantiatorRegistry());
View Full Code Here

Examples of mondrian.spi.Dialect

                continue;
            }

            // some DB2 (AS400) versions throw an error, if a column alias is
            // there and *not* used in a subsequent order by/group by
            final Dialect dialect = sqlQuery.getDialect();
            final String alias;
            final Dialect.DatabaseProduct databaseProduct =
                dialect.getDatabaseProduct();
            if (databaseProduct == Dialect.DatabaseProduct.DB2_AS400) {
                alias = sqlQuery.addSelect(expr, null);
            } else {
                alias = sqlQuery.addSelect(expr, getColumnAlias(i));
            }
View Full Code Here

Examples of net.java.textilej.parser.markup.Dialect

    return null;
  }

  private Dialect instantiateDialect(String name, Class<? extends Dialect> dialectClass) {
    try {
      Dialect dialect = dialectClass.newInstance();
      dialect.setName(name);
      return dialect;
    } catch (Exception e) {
      log(IStatus.ERROR,String.format("Cannot instantiate dialect '%' (class '%s'): %s",name,dialectClass.getName(),e.getMessage()),e);
    }
    return null;
View Full Code Here

Examples of net.sf.hajdbc.dialect.Dialect

   * @see net.sf.hajdbc.sync.SynchronizationSupport#dropUniqueConstraints()
   */
  @Override
  public void dropUniqueConstraints() throws SQLException
  {
    Dialect dialect = this.context.getDialect();

    Connection connection = this.context.getConnection(this.context.getTargetDatabase());
    boolean autoCommit = connection.getAutoCommit();
    try
    {
      connection.setAutoCommit(true);
      Statement statement = connection.createStatement();
      try
      {
        for (TableProperties table: this.context.getTargetDatabaseProperties().getTables())
        {
          for (UniqueConstraint constraint: table.getUniqueConstraints())
          {
            String sql = dialect.getDropUniqueConstraintSQL(constraint);
           
            this.logger.log(Level.DEBUG, sql);
           
            statement.addBatch(sql);
          }
View Full Code Here
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.