org.h2.value.Value.getOrder()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.h2.value.Value.getOrder()方法的一些代码示例,展示了Value.getOrder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.getOrder()方法的具体详情如下:
包路径:org.h2.value.Value
类名称:Value
方法名:getOrder

Value.getOrder介绍

[英]Get the order of this value type.
[中]获取此值类型的顺序。

代码示例

代码示例来源:origin: com.h2database/h2

/**
 * Get the higher value order type of two value types. If values need to be
 * converted to match the other operands value type, the value with the
 * lower order is converted to the value with the higher order.
 *
 * @param t1 the first value type
 * @param t2 the second value type
 * @return the higher value type of the two
 */
public static int getHigherOrder(int t1, int t2) {
  if (t1 == Value.UNKNOWN || t2 == Value.UNKNOWN) {
    if (t1 == t2) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "?, ?");
    } else if (t1 == Value.NULL) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "NULL, ?");
    } else if (t2 == Value.NULL) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "?, NULL");
    }
  }
  if (t1 == t2) {
    return t1;
  }
  int o1 = getOrder(t1);
  int o2 = getOrder(t2);
  return o1 > o2 ? t1 : t2;
}

代码示例来源:origin: com.h2database/com.springsource.org.h2

public static int getHigherOrder(int t1, int t2) throws SQLException {
  if (t1 == t2) {
    if (t1 == Value.UNKNOWN) {
      throw Message.getSQLException(ErrorCode.UNKNOWN_DATA_TYPE_1, "?, ?");
    }
    return t1;
  }
  int o1 = getOrder(t1);
  int o2 = getOrder(t2);
  return o1 > o2 ? t1 : t2;
}

代码示例来源:origin: org.wowtools/h2

/**
 * Get the higher value order type of two value types. If values need to be
 * converted to match the other operands value type, the value with the
 * lower order is converted to the value with the higher order.
 *
 * @param t1 the first value type
 * @param t2 the second value type
 * @return the higher value type of the two
 */
public static int getHigherOrder(int t1, int t2) {
  if (t1 == Value.UNKNOWN || t2 == Value.UNKNOWN) {
    if (t1 == t2) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "?, ?");
    } else if (t1 == Value.NULL) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "NULL, ?");
    } else if (t2 == Value.NULL) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "?, NULL");
    }
  }
  if (t1 == t2) {
    return t1;
  }
  int o1 = getOrder(t1);
  int o2 = getOrder(t2);
  return o1 > o2 ? t1 : t2;
}

代码示例来源:origin: com.eventsourcing/h2

/**
 * Get the higher value order type of two value types. If values need to be
 * converted to match the other operands value type, the value with the
 * lower order is converted to the value with the higher order.
 *
 * @param t1 the first value type
 * @param t2 the second value type
 * @return the higher value type of the two
 */
public static int getHigherOrder(int t1, int t2) {
  if (t1 == Value.UNKNOWN || t2 == Value.UNKNOWN) {
    if (t1 == t2) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "?, ?");
    } else if (t1 == Value.NULL) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "NULL, ?");
    } else if (t2 == Value.NULL) {
      throw DbException.get(
          ErrorCode.UNKNOWN_DATA_TYPE_1, "?, NULL");
    }
  }
  if (t1 == t2) {
    return t1;
  }
  int o1 = getOrder(t1);
  int o2 = getOrder(t2);
  return o1 > o2 ? t1 : t2;
}

相关文章