Sha256: a55a6f7585eed6695daaa2237385053de6b52841f3a2783f96788b8b9a22e020
Contents?: true
Size: 787 Bytes
Versions: 6
Compression:
Stored size: 787 Bytes
Contents
package app.domain; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.MappedSuperclass; @MappedSuperclass public class Entity { @Id @GeneratedValue private Long id; public void setId(Long id) { this.id = id; } public Long getId() { return id; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (this == obj) { return true; } if (getClass() != obj.getClass()) { return false; } final Entity other = (Entity) obj; if (id != other.id && (id == null || !id.equals(other.id))) { return false; } return true; } @Override public int hashCode() { int hash = 7; hash = 17 * hash + (this.getId() != null ? this.getId().hashCode() : 0); return hash; } }
Version data entries
6 entries across 6 versions & 2 rubygems