#247 Remove primefaces dependency #248

Merged
romanov73 merged 9 commits from 247-restore-mvc into dev 2024-05-02 13:10:01 +04:00
2 changed files with 42 additions and 17 deletions
Showing only changes of commit b49adee62a - Show all commits

View File

@ -4,17 +4,7 @@ import org.hibernate.annotations.BatchSize;
import ru.ulstu.configuration.Constants;
import ru.ulstu.core.model.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.*;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
@ -28,7 +18,6 @@ import java.util.Set;
@Table(name = "users")
public class User extends BaseEntity {
private final static String USER_ABBREVIATE_TEMPLATE = "%s %s %s";
@NotNull
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 50)
@ -39,27 +28,22 @@ public class User extends BaseEntity {
@Size(min = 60, max = 60)
@Column(name = "password_hash", length = 60, nullable = false)
private String password;
@NotNull
@Size(max = 50)
@Column(name = "first_name", length = 50, nullable = false)
private String firstName;
@NotNull
@Size(max = 50)
@Column(name = "last_name", length = 50, nullable = false)
private String lastName;
@Size(max = 50)
@Column(name = "patronymic", length = 50)
private String patronymic;
@NotNull
@Email
@Size(min = 5, max = 100)
@Column(length = 100, nullable = false, unique = true)
private String email;
@NotNull
@Column(nullable = false)
private boolean activated;
@ -96,6 +80,12 @@ public class User extends BaseEntity {
@JoinColumn(name = "blocker_id")
private User blocker;
private String orcId;
private String scopusId;
private String elibraryId;
public enum UserDegree {
CANDIDATE("Кандидат технических наук"),
DOCTOR("Доктор технических наук");
@ -242,6 +232,30 @@ public class User extends BaseEntity {
this.blocker = blocker;
}
public String getOrcId() {
return orcId;
}
public void setOrcId(String orcId) {
this.orcId = orcId;
}
public String getScopusId() {
return scopusId;
}
public void setScopusId(String scopusId) {
this.scopusId = scopusId;
}
public String getElibraryId() {
return elibraryId;
}
public void setElibraryId(String elibraryId) {
this.elibraryId = elibraryId;
}
public String getUserAbbreviate() {
return String.format(USER_ABBREVIATE_TEMPLATE,
lastName == null ? "" : lastName,

View File

@ -9,4 +9,15 @@
<addForeignKeyConstraint baseTableName="users" baseColumnNames="blocker_id" constraintName="fk_blocker"
referencedTableName="users" referencedColumnNames="id"/>
</changeSet>
<changeSet author="orion" id="20240424_000000-1">
<addColumn tableName="users">
<column name="orc_id" type="varchar(255)"/>
</addColumn>
<addColumn tableName="users">
<column name="scopus_id" type="varchar(255)"/>
</addColumn>
<addColumn tableName="users">
<column name="elibrary_id" type="varchar(255)"/>
</addColumn>
</changeSet>
</databaseChangeLog>