Package com.ibatis.sqlmap.engine.cache

Examples of com.ibatis.sqlmap.engine.cache.CacheKey


  }

  public CacheKey getCacheKey(RequestScope request, Object parameterObject) {
    Sql sql = request.getSql();
    ParameterMap pmap = sql.getParameterMap(request, parameterObject);
    CacheKey cacheKey = pmap.getCacheKey(request, parameterObject);
    cacheKey.update(id);
    cacheKey.update(baseCacheKey);
    cacheKey.update(sql.getSql(request, parameterObject)); //Fixes bug 953001
    return cacheKey;
  }
View Full Code Here


    return n;
  }

  public Object executeQueryForObject(RequestScope request, Transaction trans, Object parameterObject, Object resultObject)
      throws SQLException {
    CacheKey cacheKey = getCacheKey(request, parameterObject);
    cacheKey.update("executeQueryForObject");
    Object object = cacheModel.getObject(cacheKey);
    if (object == CacheModel.NULL_OBJECT){
      //  This was cached, but null
      object = null;
    }else if (object == null) {
View Full Code Here

    return object;
  }

  public List executeQueryForList(RequestScope request, Transaction trans, Object parameterObject, int skipResults, int maxResults)
      throws SQLException {
    CacheKey cacheKey = getCacheKey(request, parameterObject);
    cacheKey.update("executeQueryForList");
    cacheKey.update(skipResults);
    cacheKey.update(maxResults);
    Object listAsObject = cacheModel.getObject(cacheKey);
    List list;
    if(listAsObject == CacheModel.NULL_OBJECT){
      // The cached object was null
      list = null;
View Full Code Here

      throws SQLException {
    statement.executeQueryWithRowHandler(request, trans, parameterObject, rowHandler);
  }

  public CacheKey getCacheKey(RequestScope request, Object parameterObject) {
    CacheKey key = statement.getCacheKey(request, parameterObject);
    if (!cacheModel.isReadOnly() && !cacheModel.isSerialize()) {
      key.update(request.getSession());
    }
    return key;
  }
View Full Code Here

  public boolean equals(Object obj) {
    return this == obj;
  }

  public int hashCode() {
    CacheKey key = new CacheKey();
    if (txManager != null) {
      key.update(txManager);
      if (txManager.getDataSource() != null) {
        key.update(txManager.getDataSource());
      }
    }
    key.update(System.identityHashCode(this));
    return key.hashCode();
  }
View Full Code Here

    return n;
  }

  public Object executeQueryForObject(RequestScope request, Transaction trans, Object parameterObject, Object resultObject)
      throws SQLException {
    CacheKey cacheKey = getCacheKey(request, parameterObject);
    cacheKey.update("executeQueryForObject");
    Object object = cacheModel.getObject(cacheKey);
    if (object == CacheModel.NULL_OBJECT){
      //  This was cached, but null
      object = null;
    }else if (object == null) {
View Full Code Here

    return object;
  }

  public List executeQueryForList(RequestScope request, Transaction trans, Object parameterObject, int skipResults, int maxResults)
      throws SQLException {
    CacheKey cacheKey = getCacheKey(request, parameterObject);
    cacheKey.update("executeQueryForList");
    cacheKey.update(skipResults);
    cacheKey.update(maxResults);
    Object listAsObject = cacheModel.getObject(cacheKey);
    List list;
    if(listAsObject == CacheModel.NULL_OBJECT){
      // The cached object was null
      list = null;
View Full Code Here

      throws SQLException {
    statement.executeQueryWithRowHandler(request, trans, parameterObject, rowHandler);
  }

  public CacheKey getCacheKey(RequestScope request, Object parameterObject) {
    CacheKey key = statement.getCacheKey(request, parameterObject);
    if (!cacheModel.isReadOnly() && !cacheModel.isSerialize()) {
      key.update(request.getSession());
    }
    return key;
  }
View Full Code Here

  public boolean equals(Object obj) {
    return this == obj;
  }

  public int hashCode() {
    CacheKey key = new CacheKey();
    if (txManager != null) {
      key.update(txManager);
      if (txManager.getDataSource() != null) {
        key.update(txManager.getDataSource());
      }
    }
    key.update(System.identityHashCode(this));
    return key.hashCode();
  }
View Full Code Here

  protected BaseDataExchange(DataExchangeFactory dataExchangeFactory) {
    this.dataExchangeFactory = dataExchangeFactory;
  }

  public CacheKey getCacheKey(StatementScope statementScope, ParameterMap parameterMap, Object parameterObject) {
    CacheKey key = new CacheKey();
    Object[] data = getData(statementScope, parameterMap, parameterObject);
    for (int i = 0; i < data.length; i++) {
      if (data[i] != null) {
        key.update(data[i]);
      }
    }
    return key;
  }
View Full Code Here

TOP

Related Classes of com.ibatis.sqlmap.engine.cache.CacheKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.