ibatis 缓存 key 过长,大家有什么看法

实体类
public class Account implements java.io.Serializable{

  private int id;
  private String firstName;
  private String lastName;
  private String emailAddress;

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getFirstName() {
    return firstName;
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public String getEmailAddress() {
    return emailAddress;
  }

  public void setEmailAddress(String emailAddress) {
    this.emailAddress = emailAddress;
  }

}


他的缓存key 是
704038163%7C-451414988%7C10%7CselectAccountById%7C587650595%7C+++++select+++++++ACC_ID+as+id%2C+++++++ACC_FIRST_NAME+as+firstName%2C+++++++ACC_LAST_NAME+as+lastName%2C+++++++ACC_EMAIL+as+emailAddress+++++from+ACCOUNT+++++where+ACC_ID+%3D+%3F+++%7CexecuteQueryForObject

明显太长,浪费带宽和查找的时间,不知道有什么方法可以改善.
1.再hash 一下
不知是否还有其他办法

你可能感兴趣的:(ibatis)