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

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

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

Query.setSession介绍

暂无

代码示例

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  ResultInterface result = query.query(1);
  session.addTemporaryResult(result);
  boolean r = result.hasNext();
  return ValueBoolean.get(r);
}

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  try (ResultInterface result = query.query(2)) {
    Value v;
    if (!result.next()) {
      v = ValueNull.INSTANCE;
    } else {
      Value[] values = result.currentRow();
      if (result.getVisibleColumnCount() == 1) {
        v = values[0];
      } else {
        v = ValueArray.get(values);
      }
      if (result.hasNext()) {
        throw DbException.get(ErrorCode.SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW);
      }
    }
    return v;
  }
}

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  if (!query.hasOrder()) {
    query.setDistinct(true);

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

public Value getValue(Session session) throws SQLException {
  query.setSession(session);
  LocalResult result = query.query(1);
  session.addTemporaryResult(result);
  boolean r = result.getRowCount() > 0;
  return ValueBoolean.get(r);
}

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  LocalResult result = query.query(1);
  session.addTemporaryResult(result);
  boolean r = result.getRowCount() > 0;
  return ValueBoolean.get(r);
}

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  LocalResult result = query.query(1);
  session.addTemporaryResult(result);
  boolean r = result.getRowCount() > 0;
  return ValueBoolean.get(r);
}

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  try (ResultInterface result = query.query(2)) {
    int rowcount = result.getRowCount();
    if (rowcount > 1) {
      throw DbException.get(ErrorCode.SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW);
    }
    Value v;
    if (rowcount <= 0) {
      v = ValueNull.INSTANCE;
    } else {
      result.next();
      Value[] values = result.currentRow();
      if (result.getVisibleColumnCount() == 1) {
        v = values[0];
      } else {
        v = ValueArray.get(values);
      }
    }
    return v;
  }
}

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

return l;
query.setSession(session);
LocalResult rows = query.query(0);
session.addTemporaryResult(rows);

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

public Value getValue(Session session) throws SQLException {
  query.setSession(session);
  LocalResult result = query.query(2);
  try {
    int rowcount = result.getRowCount();
    if (rowcount > 1) {
      throw Message.getSQLException(ErrorCode.SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW);
    }
    Value v;
    if (rowcount <= 0) {
      v = ValueNull.INSTANCE;
    } else {
      result.next();
      Value[] values = result.currentRow();
      if (result.getVisibleColumnCount() == 1) {
        v = values[0];
      } else {
        v = ValueArray.get(values);
      }
    }
    return v;
  } finally {
    result.close();
  }
}

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  ResultInterface result = query.query(2);
  try {
    int rowcount = result.getRowCount();
    if (rowcount > 1) {
      throw DbException.get(ErrorCode.SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW);
    }
    Value v;
    if (rowcount <= 0) {
      v = ValueNull.INSTANCE;
    } else {
      result.next();
      Value[] values = result.currentRow();
      if (result.getVisibleColumnCount() == 1) {
        v = values[0];
      } else {
        v = ValueArray.get(values);
      }
    }
    return v;
  } finally {
    result.close();
  }
}

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  if (!query.hasOrder()) {
    query.setDistinct(true);

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

@Override
public Value getValue(Session session) {
  query.setSession(session);
  if (!query.hasOrder()) {
    query.setDistinct(true);

相关文章