Фиксы для работоспособности юзеров
This commit is contained in:
parent
f40bda0dc0
commit
03e593f624
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,3 +1,4 @@
|
||||
{
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
"java.configuration.updateBuildConfiguration": "interactive",
|
||||
"java.debug.settings.onBuildFailureProceed": true
|
||||
}
|
@ -6,7 +6,9 @@ import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
|
||||
@MappedSuperclass
|
||||
public class BaseEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = Constants.SEQUENCE_NAME)
|
||||
|
@ -12,8 +12,10 @@ import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.OrderBy;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "users")
|
||||
public class UserEntity extends BaseEntity {
|
||||
@Column(nullable = false)
|
||||
@ -22,7 +24,9 @@ public class UserEntity extends BaseEntity {
|
||||
private String surname;
|
||||
@Column(nullable = false)
|
||||
private Date birthday;
|
||||
@Column
|
||||
private String city;
|
||||
@Column
|
||||
private String avatarImg;
|
||||
@Column(nullable = false, unique = true)
|
||||
private String username;
|
||||
@ -30,10 +34,11 @@ public class UserEntity extends BaseEntity {
|
||||
private String password;
|
||||
@Column(nullable = false)
|
||||
private boolean isAdmin;
|
||||
@Column
|
||||
private String status;
|
||||
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
|
||||
@OrderBy("id ASC")
|
||||
private Set<PostEntity> posts = new HashSet<>();
|
||||
// @OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
|
||||
// @OrderBy("id ASC")
|
||||
// private Set<PostEntity> posts = new HashSet<>();
|
||||
|
||||
public UserEntity() {
|
||||
}
|
||||
|
BIN
nekontakte/test.mv.db
Normal file
BIN
nekontakte/test.mv.db
Normal file
Binary file not shown.
BIN
test.mv.db
Normal file
BIN
test.mv.db
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user