Examples of SqlType


Examples of com.facebook.presto.type.SqlType

            if (clazz == ConnectorSession.class) {
                continue;
            }

            // find the explicit type annotation if present
            SqlType explicitType = null;
            for (Annotation annotation : parameterAnnotations[i]) {
                if (annotation instanceof SqlType) {
                    explicitType = (SqlType) annotation;
                    break;
                }
View Full Code Here

Examples of com.facebook.presto.type.SqlType

        MethodHandle methodHandle = lookup().unreflect(method);
        String name = scalarFunction.value();
        if (name.isEmpty()) {
            name = camelToSnake(method.getName());
        }
        SqlType returnTypeAnnotation = method.getAnnotation(SqlType.class);
        checkArgument(returnTypeAnnotation != null, "Method %s return type does not have a @SqlType annotation", method);
        Type returnType = type(typeManager, returnTypeAnnotation);
        Signature signature = new Signature(name.toLowerCase(), returnType.getName(), Lists.transform(parameterTypes(typeManager, method), nameGetter()));

        verifyMethodSignature(method, signature.getReturnType(), signature.getArgumentTypes(), typeManager);
View Full Code Here

Examples of com.facebook.presto.type.SqlType

            if (clazz == ConnectorSession.class) {
                continue;
            }

            // find the explicit type annotation if present
            SqlType explicitType = null;
            for (Annotation annotation : parameterAnnotations[i]) {
                if (annotation instanceof SqlType) {
                    explicitType = (SqlType) annotation;
                    break;
                }
View Full Code Here

Examples of com.facebook.presto.type.SqlType

        if (operatorType == OperatorType.HASH_CODE) {
            // todo hack for hashCode... should be int
            returnType = BIGINT;
        }
        else {
            SqlType explicitType = method.getAnnotation(SqlType.class);
            checkArgument(explicitType != null, "Method %s return type does not have a @SqlType annotation", method);
            returnType = type(typeManager, explicitType);

            verifyMethodSignature(method, returnType.getName(), Lists.transform(parameterTypes, nameGetter()), typeManager);
        }
View Full Code Here

Examples of com.j256.ormlite.field.SqlType

  }

  @Test
  public void testSqlTypeValueConst() {
    int val = 12;
    SqlType type = SqlType.INTEGER;
    ThreadLocalSelectArg arg = new ThreadLocalSelectArg(type, val);
    assertTrue(arg.isValueSet());
    assertEquals(val, arg.getValue());
    assertEquals(type, arg.getSqlType());
  }
View Full Code Here

Examples of com.j256.ormlite.field.SqlType

        argValues = new Object[argHolders.length];
      }
      for (int i = 0; i < argHolders.length; i++) {
        Object argValue = argHolders[i].getSqlArgValue();
        FieldType fieldType = argFieldTypes[i];
        SqlType sqlType;
        if (fieldType == null) {
          sqlType = argHolders[i].getSqlType();
        } else {
          sqlType = fieldType.getSqlType();
        }
View Full Code Here

Examples of com.taobao.tddl.interact.rule.bean.SqlType

  public boolean execute() throws SQLException {
    if (log.isDebugEnabled()) {
      log.debug("invoke execute, sql = " + sql);
    }

    SqlType sqlType = SQLParser.getSqlType(sql);
    if (sqlType == SqlType.SELECT || sqlType == SqlType.SELECT_FOR_UPDATE || sqlType == SqlType.SHOW) {
      executeQuery();
      return true;
    } else if (sqlType == SqlType.INSERT || sqlType == SqlType.UPDATE || sqlType == SqlType.DELETE||sqlType == SqlType.REPLACE
        ||sqlType==SqlType.TRUNCATE|| sqlType == SqlType.CREATE|| sqlType== SqlType.DROP|| sqlType == SqlType.LOAD|| sqlType== SqlType.MERGE) {
View Full Code Here

Examples of com.taobao.tddl.interact.rule.bean.SqlType

   */
  public static SqlType getSqlType(String sql) throws SQLException {
    //#bug 2011-11-24,modify by junyu,�Ȳ��߻��棬����sql�仯�޴󣬻��滻�뻻��̫�࣬gc̫����
//    SqlType sqlType = globalCache.getSqlType(sql);
//    if (sqlType == null) {
    SqlType sqlType=null;
    //#bug 2011-12-8,modify by junyu ,this code use huge cpu resource,and most
    //sql have no comment,so first simple look for there whether have the comment
    String noCommentsSql=sql;
    if(sql.contains("/*")){
      noCommentsSql = StringUtils.stripComments(sql, "'\"", "'\"", true, false, true, true).trim();
View Full Code Here

Examples of com.taobao.tddl.interact.rule.bean.SqlType

  //jdbc�淶: ����true��ʾexecuteQuery��false��ʾexecuteUpdate
  private boolean executeInternal(String sql, int autoGeneratedKeys, int[] columnIndexes, String[] columnNames)
      throws SQLException {

    SqlType sqlType = SQLParser.getSqlType(sql);
    if (sqlType == SqlType.SELECT || sqlType == SqlType.SELECT_FOR_UPDATE || sqlType == SqlType.SHOW) {
      executeQuery(sql);
      return true;
    } else if (sqlType == SqlType.INSERT || sqlType == SqlType.UPDATE || sqlType == SqlType.DELETE||sqlType == SqlType.REPLACE||sqlType == SqlType.TRUNCATE
        || sqlType == SqlType.CREATE|| sqlType== SqlType.DROP|| sqlType == SqlType.LOAD|| sqlType== SqlType.MERGE) {
View Full Code Here

Examples of jodd.db.type.SqlType

    init();
    if (value == null) {
      setNull(index, Types.NULL);
      return;
    }
    SqlType sqlType;
    if (sqlTypeClass != null) {
      sqlType = SqlTypeManager.lookupSqlType(sqlTypeClass);
    } else {
      sqlType = SqlTypeManager.lookup(value.getClass());
    }
    try {
      if ((sqlType != null) && (dbSqlType != SqlType.DB_SQLTYPE_NOT_AVAILABLE)) {
        sqlType.storeValue(preparedStatement, index, value, dbSqlType);
      } else {
        DbUtil.setPreparedStatementObject(preparedStatement, index, value, dbSqlType);
      }
    } catch (SQLException sex) {
      throwSetParamError(index, sex);
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.