diff --git a/src/main/java/musicplayer/model/Artist.java b/src/main/java/musicplayer/model/Artist.java index 403d5be..65950eb 100644 --- a/src/main/java/musicplayer/model/Artist.java +++ b/src/main/java/musicplayer/model/Artist.java @@ -4,7 +4,7 @@ import javax.persistence.*; import java.util.Set; @Entity -public class Artist { +public class Artist implements Comparable{ @Id @GeneratedValue(strategy = GenerationType.AUTO) @@ -56,4 +56,9 @@ public class Artist { public long getId() { return id; } + + @Override + public int compareTo(Artist o) { + return toString().compareToIgnoreCase(o.toString()); + } }