Added Comparable implementation to Artist.

This commit is contained in:
neviyn 2016-02-29 02:38:51 +00:00
parent d125759c06
commit 00a4355025

View File

@ -4,7 +4,7 @@ import javax.persistence.*;
import java.util.Set;
@Entity
public class Artist {
public class Artist implements Comparable<Artist>{
@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());
}
}