fix spring boot version

This commit is contained in:
Anton Romanov 2019-06-24 14:53:55 +04:00
parent 3267138524
commit 9d3ee273f6
2 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
buildscript {
ext {
versionSpringBoot = '2.1.3.RELEASE'
versionSpringBoot = '2.1.6.RELEASE'
}
repositories {

View File

@ -7,10 +7,9 @@ import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
@MappedSuperclass
public abstract class BaseEntity implements Serializable, Comparable {
public abstract class BaseEntity implements Serializable, Comparable<BaseEntity> {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private Integer id;
@ -42,7 +41,14 @@ public abstract class BaseEntity implements Serializable, Comparable {
return false;
}
BaseEntity other = (BaseEntity) obj;
return Objects.equals(id, other.id);
if (id == null) {
if (other.id != null) {
return false;
}
} else if (!id.equals(other.id)) {
return false;
}
return true;
}
@Override
@ -62,8 +68,8 @@ public abstract class BaseEntity implements Serializable, Comparable {
}
@Override
public int compareTo(@NotNull Object o) {
return id != null ? id.compareTo(((BaseEntity) o).getId()) : -1;
public int compareTo(@NotNull BaseEntity o) {
return id != null ? id.compareTo(o.getId()) : -1;
}
public void reset() {