@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((fecha == null) ? 0 : fecha.hashCode()); result = prime * result + idOrdenDeCompra; result = prime * result + ((items == null) ? 0 : items.hashCode()); result = prime * result + ((proveedor == null) ? 0 : proveedor.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OrdenDeCompra other = (OrdenDeCompra) obj; if (fecha == null) { if (other.fecha != null) return false; } else if (!fecha.equals(other.fecha)) return false; if (idOrdenDeCompra != other.idOrdenDeCompra) return false; if (items == null) { if (other.items != null) return false; } else if (!items.equals(other.items)) return false; if (proveedor == null) { if (other.proveedor != null) return false; } else if (!proveedor.equals(other.proveedor)) return false; return true; }