Commit e2f3bcd2 by lepdou

update

parent e026c430
......@@ -16,7 +16,7 @@ import org.hibernate.annotations.Where;
@Table(name = "Cluster")
@SQLDelete(sql = "Update Cluster set isDeleted = 1 where id = ?")
@Where(clause = "isDeleted = 0")
public class Cluster extends BaseEntity implements Comparable<Cluster>{
public class Cluster extends BaseEntity implements Comparable<Cluster> {
@Column(name = "Name", nullable = false)
private String name;
......@@ -46,19 +46,16 @@ public class Cluster extends BaseEntity implements Comparable<Cluster>{
@Override
public int compareTo(Cluster o) {
if (o == null){
if (o == null) {
return 1;
}
long selfId = getId();
long targetId = o.getId();
if (selfId > targetId){
if (getId() > o.getId()) {
return 1;
}else if (selfId == targetId){
}
if (getId() == o.getId()) {
return 0;
}else {
return -1;
}
return -1;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment