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;
|
import java.util.Set;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class Artist {
|
public class Artist implements Comparable<Artist>{
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@ -56,4 +56,9 @@ public class Artist {
|
|||||||
public long getId() {
|
public long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Artist o) {
|
||||||
|
return toString().compareToIgnoreCase(o.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user