Did I implement equals and hashCode correctly using Google Guava?
问题 I am using hibernate and need to override equals and hashCode(). I chose to use google-guava's equals and hashCode helpers. I wanted to know if I am missing something here. I have get/set methods for idImage and filePath . @Entity @Table(name = "IMAGE") public class ImageEntity { private Integer idImage; private String filePath; @Override public int hashCode() { return Objects.hashCode(getFilePath()); } @Override public boolean equals(final Object obj) { if(obj == this) return true; if(obj ==