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 { buildscript {
ext { ext {
versionSpringBoot = '2.1.3.RELEASE' versionSpringBoot = '2.1.6.RELEASE'
} }
repositories { repositories {

View File

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