Added Comparable implementation to Artist.
This commit is contained in:
parent
d125759c06
commit
00a4355025
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user