EsiteUserShoppingCartPK.java
上传用户:jnhyscl
上传日期:2010-03-08
资源大小:345k
文件大小:1k
源码类别:

电子政务应用

开发平台:

Java

  1. package shiponline;
  2. import java.io.*;
  3. public class EsiteUserShoppingCartPK
  4.     implements Serializable {
  5.   public Integer user;
  6.   public Integer shoppingCartUserid;
  7.   public Integer shoppingCartInventoryid;
  8.   public EsiteUserShoppingCartPK() {
  9.   }
  10.   public EsiteUserShoppingCartPK(Integer user, Integer shoppingCartUserid,
  11.                                  Integer shoppingCartInventoryid) {
  12.     this.user = user;
  13.     this.shoppingCartUserid = shoppingCartUserid;
  14.     this.shoppingCartInventoryid = shoppingCartInventoryid;
  15.   }
  16.   public boolean equals(Object obj) {
  17.     if (obj != null) {
  18.       if (this.getClass().equals(obj.getClass())) {
  19.         EsiteUserShoppingCartPK that = (EsiteUserShoppingCartPK) obj;
  20.         return ( ( (this.user == null) && (that.user == null)) ||
  21.                 (this.user != null && this.user.equals(that.user))) &&
  22.             ( ( (this.shoppingCartUserid == null) && (that.shoppingCartUserid == null)) ||
  23.              (this.shoppingCartUserid != null &&
  24.               this.shoppingCartUserid.equals(that.shoppingCartUserid))) &&
  25.             ( ( (this.shoppingCartInventoryid == null) &&
  26.                (that.shoppingCartInventoryid == null)) ||
  27.              (this.shoppingCartInventoryid != null &&
  28.               this.shoppingCartInventoryid.equals(that.shoppingCartInventoryid)));
  29.       }
  30.     }
  31.     return false;
  32.   }
  33.   public int hashCode() {
  34.     return (user + "" + shoppingCartUserid + shoppingCartInventoryid).hashCode();
  35.   }
  36. }