resultsetimpl.java

来自「RESIN 3.2 最新源码」· Java 代码 · 共 2,011 行 · 第 1/3 页

JAVA
2,011
字号
  }  /**   * Returns the float value for the column.   */  public float getFloat(String columnName)    throws SQLException  {    int column = getColumn(columnName);    if (_cacheChunk != null)      return _cacheChunk.getFloat(_row - 1, column - 1);    else      return _rs.getFloat(column);  }  /**   * Returns the float value for the column.   */  public float getFloat(int column)    throws SQLException  {    if (_cacheChunk != null)      return _cacheChunk.getFloat(_row - 1, column - 1);    else      return _rs.getFloat(column);  }  /**   * Returns the double value for the column.   */  public double getDouble(String columnName)    throws SQLException  {    int column = getColumn(columnName);    if (_cacheChunk != null)      return _cacheChunk.getDouble(_row - 1, column - 1);    else      return _rs.getDouble(column);  }  /**   * Returns the double value for the column.   */  public double getDouble(int column)    throws SQLException  {    if (_cacheChunk != null)      return _cacheChunk.getDouble(_row - 1, column - 1);    else      return _rs.getDouble(column);  }  /**   * Returns the string value for the column.   */  public String getString(int column)    throws SQLException  {    if (_cacheChunk != null)      return _cacheChunk.getString(_row - 1, column - 1);    else      return _rs.getString(column);  }  /**   * Returns the string value for the column.   */  public String getString(String columnName)    throws SQLException  {    int column = getColumn(columnName);    if (_cacheChunk != null)      return _cacheChunk.getString(_row - 1, column - 1);    else      return _rs.getString(column);  }  /**   * Returns the bytes value for the column.   */  public byte []getBytes(int column)    throws SQLException  {    return _rs.getBytes(getColumn(column));  }  /**   * Returns the bytes value for the column.   */  public byte []getBytes(String column)    throws SQLException  {    return _rs.getBytes(getColumn(column));  }  /**   * Returns the column value as a date.   */  public java.sql.Date getDate(int column)    throws SQLException  {    return _rs.getDate(getColumn(column));  }  /**   * Returns the column value as a date.   */  public java.sql.Date getDate(String column)    throws SQLException  {    return _rs.getDate(getColumn(column));  }  /**   * Returns the column value as a date.   */  public java.sql.Date getDate(int column, Calendar cal)    throws SQLException  {    return _rs.getDate(getColumn(column), cal);  }  /**   * Returns the column value as a date.   */  public java.sql.Date getDate(String column, Calendar cal)    throws SQLException  {    return _rs.getDate(getColumn(column), cal);  }  /**   * Returns the time value for the column.   */  public Time getTime(int column)    throws SQLException  {    return _rs.getTime(getColumn(column));  }  /**   * Returns the time value for the column.   */  public Time getTime(String column)    throws SQLException  {    return _rs.getTime(getColumn(column));  }  /**   * Returns the time value for the column.   */  public Time getTime(int column, Calendar cal)    throws SQLException  {    return _rs.getTime(getColumn(column), cal);  }  /**   * Returns the time value for the column.   */  public Time getTime(String column, Calendar cal)    throws SQLException  {    return _rs.getTime(getColumn(column), cal);  }  /**   * Returns the column as a timestamp.   */  public Timestamp getTimestamp(int column)    throws SQLException  {    return _rs.getTimestamp(getColumn(column));  }  /**   * Returns the column as a timestamp.   */  public Timestamp getTimestamp(String column)    throws SQLException  {    return _rs.getTimestamp(getColumn(column));  }  /**   * Returns the column as a timestamp.   */  public Timestamp getTimestamp(int column, Calendar cal)    throws SQLException  {    return _rs.getTimestamp(getColumn(column), cal);  }  /**   * Returns the column as a timestamp.   */  public Timestamp getTimestamp(String column, Calendar cal)    throws SQLException  {    return _rs.getTimestamp(getColumn(column), cal);  }  /**   * Returns a ref value for the column.   */  public Ref getRef(int column)    throws SQLException  {    return _rs.getRef(getColumn(column));  }  /**   * Returns a ref value for the column.   */  public Ref getRef(String column)    throws SQLException  {    return _rs.getRef(getColumn(column));  }  /**   * Returns a clob value for the column.   */  public Clob getClob(int column)    throws SQLException  {    return _rs.getClob(getColumn(column));  }  /**   * Returns a clob value for the column.   */  public Clob getClob(String column)    throws SQLException  {    return _rs.getClob(getColumn(column));  }  /**   * Returns a blob value for the column.   */  public Blob getBlob(int column)    throws SQLException  {    return _rs.getBlob(getColumn(column));  }  /**   * Returns a blob value for the column.   */  public Blob getBlob(String column)    throws SQLException  {    return _rs.getBlob(getColumn(column));  }  /**   * Returns a character stream for the column.   */  public Reader getCharacterStream(int column)    throws SQLException  {    return _rs.getCharacterStream(getColumn(column));  }  /**   * Returns a character stream for the column.   */  public Reader getCharacterStream(String column)    throws SQLException  {    return _rs.getCharacterStream(getColumn(column));  }  /**   * Returns a binary stream for the column.   */  public InputStream getBinaryStream(int column)    throws SQLException  {    return _rs.getBinaryStream(getColumn(column));  }  /**   * Returns a binary stream for the column.   */  public InputStream getBinaryStream(String column)    throws SQLException  {    return _rs.getBinaryStream(getColumn(column));  }  /**   * Returns an ascii stream for the column.   */  public InputStream getAsciiStream(int column)    throws SQLException  {    return _rs.getAsciiStream(getColumn(column));  }  /**   * Returns an ascii stream for the column.   */  public InputStream getAsciiStream(String column)    throws SQLException  {    return _rs.getAsciiStream(getColumn(column));  }  /**   * Returns a unicode stream for the column.   */  public InputStream getUnicodeStream(int column)    throws SQLException  {    return _rs.getUnicodeStream(getColumn(column));  }  /**   * Returns a unicode stream for the column.   */  public InputStream getUnicodeStream(String column)    throws SQLException  {    return _rs.getUnicodeStream(getColumn(column));  }  /**   * Returns an array value for the column.   */  public Array getArray(int column)    throws SQLException  {    return _rs.getArray(getColumn(column));  }  /**   * Returns an array value for the column.   */  public Array getArray(String column)    throws SQLException  {    return _rs.getArray(getColumn(column));  }  /**   * Returns a URL value for the column.   */  public URL getURL(int column)    throws SQLException  {    return _rs.getURL(getColumn(column));  }  /**   * Returns a URL value for the column.   */  public URL getURL(String column)    throws SQLException  {    return _rs.getURL(getColumn(column));  }  /**   * Returns a big decimal value for the column.   */  public BigDecimal getBigDecimal(int column)    throws SQLException  {    return _rs.getBigDecimal(getColumn(column));  }  /**   * Returns a big decimal value for the column.   */  public BigDecimal getBigDecimal(String column)    throws SQLException  {    return _rs.getBigDecimal(getColumn(column));  }  /**   * Returns a big decimal value for the column.   */  public BigDecimal getBigDecimal(int column, int digit)    throws SQLException  {    return _rs.getBigDecimal(getColumn(column), digit);  }  /**   * Returns a big decimal value for the column.   */  public BigDecimal getBigDecimal(String column, int digit)    throws SQLException  {    return _rs.getBigDecimal(getColumn(column), digit);  }  /**   * Returns the object value for the column.   */  public Object getObject(int column)    throws SQLException  {    ResultSetCacheChunk cacheChunk = _cacheChunk;    Object value = null;    if (cacheChunk != null) {      if (log.isLoggable(Level.FINER))        log.finer(L.l("amber Query returning cached getObject({0})", column));      Object obj = cacheChunk.getObject(_row - 1, column - 1);      if (obj instanceof EntityItem) {        EntityItem entityItem = (EntityItem) obj;	if (_session.isJPA())	  return _session.getEntity(entityItem);	else	  return _session.loadProxy(entityItem);                /*        Entity entity = entityItem.getEntity();        int index = getColumn(column);        AmberExpr expr = _resultList.get(column - 1);        EntityType entityType = entity.__caucho_getEntityType();        boolean forceLoad = false;        // jpa/0gf1        // XXX: assert.        if (expr instanceof LoadEntityExpr) {          LoadEntityExpr entityExpr = (LoadEntityExpr) expr;          if (entityType != entityExpr.getEntityType()) {            forceLoad = true;            entityType = entityExpr.getEntityType();          }        }        if (entityType.getParentType() == null && ! forceLoad) {          value = _session.loadProxy(entityType,                                     entity.__caucho_getPrimaryKey());        }        else {          // jpa/0l4a          value = _session.loadFromHome(entityType.getBeanClass().getName(),                                        entity.__caucho_getPrimaryKey());        }        _numberOfLoadingColumns = entityItem.getNumberOfLoadingColumns();        */      }      else {        value = obj;      }    }    else {      int index = getColumn(column);      AmberExpr expr = _resultList.get(column - 1);      if (_session == null)	throw new NullPointerException();      value = expr.getObject(_session, _rs, index);      /*      if (expr instanceof LoadEntityExpr) {        if (log.isLoggable(Level.FINER))          log.log(Level.FINER, L.l("ResultSetImpl expr is instance of LoadEntityExpr"));        LoadEntityExpr entityExpr = (LoadEntityExpr) expr;        _numberOfLoadingColumns = entityExpr.getIndex();      }      */    }    // jpa/0o40, jpa/1160    if (value instanceof Entity) {      Entity entity = (Entity) value;      if (_session.isActiveTransaction())        _session.setTransactionalState(entity);      // jpa/1160      // Should always add the entity to the context      // and detach the entities after the result      // list is fully retrieved. See manager.QueryImpl      // XXX: should already be handled      // _session.addEntity(entity);      if (! _session.isJPA())	return _session.loadProxy(entity.__caucho_getCacheItem());    }    return value;  }  /**   * Returns the object value for the column.   */  public EntityItem findEntityItem(int column)    throws SQLException  {    ResultSetCacheChunk cacheChunk = _cacheChunk;    if (cacheChunk != null) {      Object obj = cacheChunk.getObject(_row - 1, column - 1);      if (obj instanceof EntityItem) {        return (EntityItem) obj;      }      else        throw new SQLException(L.l("'{0}' is an unexpected type.",                                   obj));    }    else {      int index = getColumn(column);      AmberExpr expr = _resultList.get(column - 1);      EntityItem item = expr.findItem(_session, _rs, index);      return item;    }    /*      FromItem item = _fromList.get(column - 1);      AmberEntityHome home = item.getEntityHome();      return home.load(_session, _rs, index);    */  }  /**   * Returns the object value for the column.   */  public Object getObject(String column)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Returns the object value for the column.   */  public Object getKey(int column)    throws SQLException  {    int index = getColumn(column);    FromItem item = _fromList.get(column - 1);    AmberEntityHome home = item.getEntityHome();    Object key = home.getEntityType().getId().getObject(_rs, index);    return key;  }  /**   * Returns the object value for the column.   */  public Object getObject(int column, Map<String,Class<?>> map)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Returns the object value for the column.   */  public Object getObject(String column, Map<String,Class<?>> map)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating a string column in the row.   */  public void updateString(String column, String value)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating a string column in the row.   */  public void updateString(int column, String value)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating an object column in the row.   */  public void updateObject(String column, Object value)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating an object column in the row.   */  public void updateObject(int column, Object value)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating an object column in the row.   */  public void updateObject(String column, Object value, int scale)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating an object column in the row.   */  public void updateObject(int column, Object value, int scale)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating a timestamp column in the row.   */  public void updateTimestamp(String column, Timestamp timestamp)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating a timestamp column in the row.   */  public void updateTimestamp(int column, Timestamp timestamp)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating a time column in the row.   */  public void updateTime(String column, Time time)    throws SQLException  {    throw new UnsupportedOperationException();  }  /**   * Updating a time column in the row.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?