From f7d766f02df969b8764c3d8fc91d61452d1ffec4 Mon Sep 17 00:00:00 2001 From: T-Midnight Date: Thu, 11 Apr 2019 21:37:24 +0400 Subject: [PATCH] #42 rename birth_date column --- src/main/java/ru/ulstu/user/model/User.java | 12 ++++++------ src/main/java/ru/ulstu/user/model/UserDto.java | 14 +++++++------- .../db/changelog-20190404_000000-schema.xml | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/ru/ulstu/user/model/User.java b/src/main/java/ru/ulstu/user/model/User.java index 974ca82..7c8eaf3 100644 --- a/src/main/java/ru/ulstu/user/model/User.java +++ b/src/main/java/ru/ulstu/user/model/User.java @@ -85,9 +85,9 @@ public class User extends BaseEntity { @BatchSize(size = 20) private Set roles; - @Column(name = "birth_year") + @Column(name = "birth_date") @Temporal(TemporalType.TIMESTAMP) - private Date birthYear; + private Date birthDate; public enum UserDegree { CANDIDATE("Кандидат технических наук"), @@ -211,12 +211,12 @@ public class User extends BaseEntity { this.patronymic = patronymic; } - public Date getBirthYear() { - return birthYear; + public Date getBirthDate() { + return birthDate; } - public void setBirthYear(Date birthYear) { - this.birthYear = birthYear; + public void setBirthDate(Date birthDate) { + this.birthDate = birthDate; } public UserDegree getDegree() { diff --git a/src/main/java/ru/ulstu/user/model/UserDto.java b/src/main/java/ru/ulstu/user/model/UserDto.java index 8157b63..39ff913 100644 --- a/src/main/java/ru/ulstu/user/model/UserDto.java +++ b/src/main/java/ru/ulstu/user/model/UserDto.java @@ -71,7 +71,7 @@ public class UserDto implements OdinDto { @Size(min = Constants.MIN_PASSWORD_LENGTH, max = 50) private String passwordConfirm; - private Date birthYear; + private Date birthDate; private User.UserDegree degree; @@ -91,7 +91,7 @@ public class UserDto implements OdinDto { this.roles.addAll(user.getRoles().stream() .map(UserRoleDto::new) .collect(Collectors.toList())); - this.birthYear = user.getBirthYear(); + this.birthDate = user.getBirthDate(); this.degree = user.getDegree(); } @@ -170,12 +170,12 @@ public class UserDto implements OdinDto { return passwordConfirm; } - public Date getBirthYear() { - return birthYear; + public Date getBirthDate() { + return birthDate; } - public void setBirthYear(Date birthYear) { - this.birthYear = birthYear; + public void setBirthDate(Date birthDate) { + this.birthDate = birthDate; } public User.UserDegree getDegree() { @@ -211,7 +211,7 @@ public class UserDto implements OdinDto { ", roles=" + roles + ", password='" + password + '\'' + ", passwordConfirm='" + passwordConfirm + '\'' + - ", birthYear='" + birthYear + '\'' + + ", birthDate='" + birthDate + '\'' + ", degree='" + degree + '\'' + '}'; } diff --git a/src/main/resources/db/changelog-20190404_000000-schema.xml b/src/main/resources/db/changelog-20190404_000000-schema.xml index a92a99d..0f45e31 100644 --- a/src/main/resources/db/changelog-20190404_000000-schema.xml +++ b/src/main/resources/db/changelog-20190404_000000-schema.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> - +