Skip to content

Commit

Permalink
feat: 解决接口慢问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lichong-a committed Sep 23, 2024
1 parent 4fd285b commit 109ac54
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class Role extends BaseEntity implements GrantedAuthority {
name = "tb_role_basic_authority",
joinColumns = @JoinColumn(name = "role_id"),
inverseJoinColumns = @JoinColumn(name = "basic_authority_id"))
@JsonIgnore
@ToString.Exclude
private Set<BasicAuthority> basicAuthorities;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ public class User extends BaseEntity implements UserDetails {
@Comment("是否启用")
@Schema(description = "是否启用")
private boolean enabled = true;
@ManyToMany(fetch = FetchType.LAZY)
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(
name = "tb_user_role",
joinColumns = @JoinColumn(name = "user_id"),
inverseJoinColumns = @JoinColumn(name = "role_id"))
@ToString.Exclude
private Set<Role> roles;

@OneToMany(fetch = FetchType.EAGER)
@OneToMany
@ToString.Exclude
@JsonBackReference
private Set<Order> orders;
Expand Down
2 changes: 1 addition & 1 deletion starter/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ spring:
max-wait: 2000
jpa:
generate-ddl: true
open-in-view: true
open-in-view: false
hibernate:
ddl-auto: update
show-sql: true
Expand Down

0 comments on commit 109ac54

Please sign in to comment.