yours-truly-phil / SOULHub

Serves SOUL (Sound Language) Patches
MIT License
7 stars 0 forks source link

Abstract Entity #44

Open yours-truly-phil opened 4 years ago

yours-truly-phil commented 4 years ago

Entities extend AuditModel class, so renaming AuditModel to AbstractEntity

Add a @Version attribute Move the @Id to the abstract entity

create equals with equals if o1 == o2 and not equal if null or getClass() different and sth like

AbstractEntity that = (AbstractEntity) o;
return version == that.version &&
        Objects.equals(id, that.id);

also add a hashCode that hashes id and version exclusively

then think about if it makes sense to remove the lombok stuff for equals hashcode of the entities (since they can now use the abstractentity)