org.hibernate.cfg.Settings.isScrollableResultSetsEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(238)

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

Settings.isScrollableResultSetsEnabled介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Advance the cursor to the first required row of the <tt>ResultSet</tt>
 */
protected void advance(final ResultSet rs, final RowSelection selection) throws SQLException {
  final int firstRow = LimitHelper.getFirstRow( selection );
  if ( firstRow != 0 ) {
    if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) {
      // we can go straight to the first required row
      rs.absolute( firstRow );
    }
    else {
      // we need to step through the rows one row at a time (slow)
      for ( int m = 0; m < firstRow; m++ ) {
        rs.next();
      }
    }
  }
}

代码示例来源:origin: hibernate/hibernate-orm

protected ScrollMode getScrollMode(boolean scroll, boolean hasFirstRow, boolean useLimitOffSet, QueryParameters queryParameters) {
  final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled();
  if ( canScroll ) {
    if ( scroll ) {
      return queryParameters.getScrollMode();
    }
    if ( hasFirstRow && !useLimitOffSet ) {
      return ScrollMode.SCROLL_INSENSITIVE;
    }
  }
  return null;
}

代码示例来源:origin: hibernate/hibernate

private CallableStatement getCallableStatement( final Connection conn, 
    final String sql, 
    boolean scrollable)
throws SQLException {
  if ( scrollable && !factory.getSettings().isScrollableResultSetsEnabled() ) {
    throw new AssertionFailure("scrollable result sets are not enabled");
  }
  log(sql);
  
  log.trace("preparing callable statement");
  if (scrollable) {
    return conn.prepareCall(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
  }
  else {
    return conn.prepareCall(sql);
  }
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

/**
 * Advance the cursor to the first required row of the <tt>ResultSet</tt>
 */
private void advance(final ResultSet rs, final RowSelection selection)
    throws SQLException {
  final int firstRow = getFirstRow( selection );
  if ( firstRow != 0 ) {
    if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) {
      // we can go straight to the first required row
      rs.absolute( firstRow );
    }
    else {
      // we need to step through the rows one row at a time (slow)
      for ( int m = 0; m < firstRow; m++ ) rs.next();
    }
  }
}

代码示例来源:origin: hibernate/hibernate

/**
 * Advance the cursor to the first required row of the <tt>ResultSet</tt>
 */
private void advance(final ResultSet rs, final RowSelection selection)
    throws SQLException {
  final int firstRow = getFirstRow( selection );
  if ( firstRow != 0 ) {
    if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) {
      // we can go straight to the first required row
      rs.absolute( firstRow );
    }
    else {
      // we need to step through the rows one row at a time (slow)
      for ( int m = 0; m < firstRow; m++ ) rs.next();
    }
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Advance the cursor to the first required row of the <tt>ResultSet</tt>
 */
private void advance(final ResultSet rs, final RowSelection selection)
    throws SQLException {
  final int firstRow = getFirstRow( selection );
  if ( firstRow != 0 ) {
    if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) {
      // we can go straight to the first required row
      rs.absolute( firstRow );
    }
    else {
      // we need to step through the rows one row at a time (slow)
      for ( int m = 0; m < firstRow; m++ ) rs.next();
    }
  }
}

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

/**
 * Advance the cursor to the first required row of the <tt>ResultSet</tt>
 */
private void advance(final ResultSet rs, final RowSelection selection)
    throws SQLException {
  final int firstRow = getFirstRow( selection );
  if ( firstRow != 0 ) {
    if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) {
      // we can go straight to the first required row
      rs.absolute( firstRow );
    }
    else {
      // we need to step through the rows one row at a time (slow)
      for ( int m = 0; m < firstRow; m++ ) rs.next();
    }
  }
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

private CallableStatement getCallableStatement(
    final Connection conn,
    String sql,
    boolean scrollable) throws SQLException {
  if ( scrollable && !factory.getSettings().isScrollableResultSetsEnabled() ) {
    throw new AssertionFailure("scrollable result sets are not enabled");
  }
  sql = getSQL( sql );
  log( sql );
  log.trace("preparing callable statement");
  if ( scrollable ) {
    return conn.prepareCall(
        sql,
        ResultSet.TYPE_SCROLL_INSENSITIVE,
        ResultSet.CONCUR_READ_ONLY
    );
  }
  else {
    return conn.prepareCall( sql );
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private ScrollMode getScrollMode(boolean scroll, boolean hasFirstRow, boolean useLimitOffSet, QueryParameters queryParameters) {
  final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled();
  if ( canScroll ) {
    if ( scroll ) {
      return queryParameters.getScrollMode();
    }
    if ( hasFirstRow && !useLimitOffSet ) {
      return ScrollMode.SCROLL_INSENSITIVE;
    }
  }
  return null;
}
/**

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

private ScrollMode getScrollMode(boolean scroll, boolean hasFirstRow, boolean useLimitOffSet, QueryParameters queryParameters) {
  final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled();
  if ( canScroll ) {
    if ( scroll ) {
      return queryParameters.getScrollMode();
    }
    if ( hasFirstRow && !useLimitOffSet ) {
      return ScrollMode.SCROLL_INSENSITIVE;
    }
  }
  return null;
}
/**

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

final ScrollMode scrollMode,
  final boolean callable) throws SQLException {
if ( scrollable && !factory.getSettings().isScrollableResultSetsEnabled() ) {
  throw new AssertionFailure("scrollable result sets are not enabled");

代码示例来源:origin: hibernate/hibernate

throws SQLException {
  if ( scrollable && !factory.getSettings().isScrollableResultSetsEnabled() ) {
    throw new AssertionFailure("scrollable result sets are not enabled");

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

final ScrollMode scrollMode) {
if ( scrollMode != null && !scrollMode.equals( ScrollMode.FORWARD_ONLY ) ) {
  if ( ! settings().isScrollableResultSetsEnabled() ) {
    throw new AssertionFailure("scrollable result sets are not enabled");

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

final ScrollMode scrollMode) {
if ( scrollMode != null && !scrollMode.equals( ScrollMode.FORWARD_ONLY ) ) {
  if ( ! settings().isScrollableResultSetsEnabled() ) {
    throw new AssertionFailure("scrollable result sets are not enabled");

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

boolean callable = queryParameters.isCallable();
final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled();
final boolean useScrollableResultSetToSkip = hasFirstRow &&
    !useLimitOffset && canScroll;

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

boolean callable = queryParameters.isCallable();
final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled();
final boolean useScrollableResultSetToSkip = hasFirstRow &&
    !useLimitOffset && canScroll;

代码示例来源:origin: hibernate/hibernate

getFactory().getSettings().isScrollableResultSetsEnabled();
ScrollMode scrollMode = scroll ? queryParameters.getScrollMode() : ScrollMode.SCROLL_INSENSITIVE;

相关文章

Settings类方法