org.h2.command.dml.Query.getMaxDataModificationId()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(232)

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

Query.getMaxDataModificationId介绍

暂无

代码示例

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

@Override
public long getMaxDataModificationId() {
  if (createException != null) {
    return Long.MAX_VALUE;
  }
  if (viewQuery == null) {
    return Long.MAX_VALUE;
  }
  // if nothing was modified in the database since the last check, and the
  // last is known, then we don't need to check again
  // this speeds up nested views
  long dbMod = database.getModificationDataId();
  if (dbMod > lastModificationCheck && maxDataModificationId <= dbMod) {
    maxDataModificationId = viewQuery.getMaxDataModificationId();
    lastModificationCheck = dbMod;
  }
  return maxDataModificationId;
}

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

private boolean sameResultAsLast(Session s, Value[] params,
    Value[] lastParams, long lastEval) {
  if (!cacheableChecked) {
    long max = getMaxDataModificationId();
    noCache = max == Long.MAX_VALUE;
    cacheableChecked = true;
  }
  if (noCache) {
    return false;
  }
  Database db = s.getDatabase();
  for (int i = 0; i < params.length; i++) {
    Value a = lastParams[i], b = params[i];
    if (a.getType() != b.getType() || !db.areEqual(a, b)) {
      return false;
    }
  }
  if (!isEverything(ExpressionVisitor.DETERMINISTIC_VISITOR) ||
      !isEverything(ExpressionVisitor.INDEPENDENT_VISITOR)) {
    return false;
  }
  if (db.getModificationDataId() > lastEval &&
      getMaxDataModificationId() > lastEval) {
    return false;
  }
  return true;
}

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

@Override
public long getMaxDataModificationId() {
  if (createException != null) {
    return Long.MAX_VALUE;
  }
  if (viewQuery == null) {
    return Long.MAX_VALUE;
  }
  // if nothing was modified in the database since the last check, and the
  // last is known, then we don't need to check again
  // this speeds up nested views
  long dbMod = database.getModificationDataId();
  if (dbMod > lastModificationCheck && maxDataModificationId <= dbMod) {
    maxDataModificationId = viewQuery.getMaxDataModificationId();
    lastModificationCheck = dbMod;
  }
  return maxDataModificationId;
}

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

@Override
public long getMaxDataModificationId() {
  if (createException != null) {
    return Long.MAX_VALUE;
  }
  if (viewQuery == null) {
    return Long.MAX_VALUE;
  }
  // if nothing was modified in the database since the last check, and the
  // last is known, then we don't need to check again
  // this speeds up nested views
  long dbMod = database.getModificationDataId();
  if (dbMod > lastModificationCheck && maxDataModificationId <= dbMod) {
    maxDataModificationId = viewQuery.getMaxDataModificationId();
    lastModificationCheck = dbMod;
  }
  return maxDataModificationId;
}

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

public long getMaxDataModificationId() {
  if (createException != null) {
    throw Message.getInternalError();
  }
  if (viewQuery == null) {
    return Long.MAX_VALUE;
  }
  // if nothing was modified in the database since the last check, and the
  // last is known, then we don't need to check again
  // this speeds up nested views
  long dbMod = database.getModificationDataId();
  if (dbMod > lastModificationCheck && maxDataModificationId <= dbMod) {
    maxDataModificationId = viewQuery.getMaxDataModificationId();
    lastModificationCheck = dbMod;
  }
  return maxDataModificationId;
}

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

private boolean sameResultAsLast(Session s, Value[] params,
    Value[] lastParams, long lastEval) {
  if (!cacheableChecked) {
    long max = getMaxDataModificationId();
    noCache = max == Long.MAX_VALUE;
    cacheableChecked = true;
  }
  if (noCache) {
    return false;
  }
  Database db = s.getDatabase();
  for (int i = 0; i < params.length; i++) {
    Value a = lastParams[i], b = params[i];
    if (a.getType() != b.getType() || !db.areEqual(a, b)) {
      return false;
    }
  }
  if (!isEverything(ExpressionVisitor.DETERMINISTIC_VISITOR) ||
      !isEverything(ExpressionVisitor.INDEPENDENT_VISITOR)) {
    return false;
  }
  if (db.getModificationDataId() > lastEval &&
      getMaxDataModificationId() > lastEval) {
    return false;
  }
  return true;
}

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

private boolean sameResultAsLast(Session s, Value[] params,
    Value[] lastParams, long lastEval) {
  if (!cacheableChecked) {
    long max = getMaxDataModificationId();
    noCache = max == Long.MAX_VALUE;
    cacheableChecked = true;
  }
  if (noCache) {
    return false;
  }
  Database db = s.getDatabase();
  for (int i = 0; i < params.length; i++) {
    Value a = lastParams[i], b = params[i];
    if (a.getType() != b.getType() || !db.areEqual(a, b)) {
      return false;
    }
  }
  if (!isEverything(ExpressionVisitor.DETERMINISTIC_VISITOR) ||
      !isEverything(ExpressionVisitor.INDEPENDENT_VISITOR)) {
    return false;
  }
  if (db.getModificationDataId() > lastEval &&
      getMaxDataModificationId() > lastEval) {
    return false;
  }
  return true;
}

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

private boolean sameResultAsLast(Session session, Value[] params, Value[] lastParams, long lastEvaluated)
    throws SQLException {
  Database db = session.getDatabase();
  for (int i = 0; i < params.length; i++) {
    if (!db.areEqual(lastParams[i], params[i])) {
      return false;
    }
  }
  if (!isEverything(ExpressionVisitor.DETERMINISTIC) || !isEverything(ExpressionVisitor.INDEPENDENT)) {
    return false;
  }
  if (db.getModificationDataId() > lastEvaluated && getMaxDataModificationId() > lastEvaluated) {
    return false;
  }
  return true;
}

相关文章