Э
Size: a a a
Э
V
DC
new SomeType();
В остальных случаях увеличивает время понимания, какой тип у переменной/ константыА
А
@Entity
@Table(name = "t_role")
public class Role implements GrantedAuthority {
@Id
private Long id;
private String name;
@Transient
@ManyToMany(mappedBy = "roles")
private Set<User> users;
А
@Entity
@Table(name = "t_user")
public class User implements UserDetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Size(min=2, message = "Не меньше 5 знаков")
private String username;
@Size(min=2, message = "Не меньше 5 знаков")
private String password;
@Transient
private String passwordConfirm;
@ManyToMany(fetch = FetchType.EAGER)
private Set<Role> roles;
А
А
create table if not exists Role(
id bigint primary key auto_increment,
name varchar(255) not null,
user_id bigint,
foreign key (user_id) REFERENCES user (id)
);
create table if not exists User(
id bigint primary key auto_increment,
name varchar(255) not null,
password varchar(255) not null,
role_id bigint,
foreign key (role_id) references role(id)
);
А
Dm
Dm
Dm
Э
create table if not exists Role(
id bigint primary key auto_increment,
name varchar(255) not null,
user_id bigint,
foreign key (user_id) REFERENCES user (id)
);
create table if not exists User(
id bigint primary key auto_increment,
name varchar(255) not null,
password varchar(255) not null,
role_id bigint,
foreign key (role_id) references role(id)
);
user_id
в Role
?Dm
Э
А
user_id
в Role
?А
Dm
Dm
Dm