Java 多对多spring jpa不返回JSON中的所有数据

Java 多对多spring jpa不返回JSON中的所有数据,java,spring-boot,hibernate,jpa,spring-data-jpa,Java,Spring Boot,Hibernate,Jpa,Spring Data Jpa,我创造了一种多对多的关系。它正在正确返回数据。但是,我注意到,如果数据存在于json的canUse部分,并且之前被另一个播放器调用过,那么它不会再次打印数据,只会打印新的值 乔森 玩家实体 @Entity @Table(name = "players") @EntityListeners(AuditingEntityListener.class) @JsonIdentityInfo( generator = ObjectIdGenerators.Propert

我创造了一种多对多的关系。它正在正确返回数据。但是,我注意到,如果数据存在于json的canUse部分,并且之前被另一个播放器调用过,那么它不会再次打印数据,只会打印新的值

乔森

玩家实体

@Entity
@Table(name = "players")
@EntityListeners(AuditingEntityListener.class)
@JsonIdentityInfo(
        generator = ObjectIdGenerators.PropertyGenerator.class,
        property = "id")
public class Players {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="player_id")
    private int id;
    private String firstname;
    private String surname;
    @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinTable(
            name = "able_to_use",
            joinColumns = {@JoinColumn(name = "player_id", referencedColumnName = "player_id")},
            inverseJoinColumns = {@JoinColumn(name = "technique_id", referencedColumnName = "id")}
    )
    private List<Technique> canUse;
    //Getters and Setters
@实体
@表(name=“players”)
@EntityListeners(AuditingEntityListener.class)
@JsonIdentityInfo(
生成器=ObjectedGenerators.PropertyGenerator.class,
property=“id”)
公营球员{
@身份证
@GeneratedValue(策略=GenerationType.AUTO)
@列(name=“player\u id”)
私有int-id;
私有字符串名;
私家姓;
@ManyToMany(fetch=FetchType.EAGER,cascade=CascadeType.ALL)
@可接合(
name=“能够使用”,
joinColumns={@JoinColumn(name=“player\u id”,referencedColumnName=“player\u id”)},
inverseJoinColumns={@JoinColumn(name=“technology\u id”,referencedColumnName=“id”)}
)
私人名单可以使用;
//接球手和接球手
技术实体

@Entity
@Table(name = "technique")
@EntityListeners(AuditingEntityListener.class)

@JsonIdentityInfo(
        generator = ObjectIdGenerators.PropertyGenerator.class,
        property = "id")
public class Technique {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    @Column(name = "technique_name")
    private String techniqueName;
    @JsonIgnore
    @ManyToMany(mappedBy = "canUse", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    private List<Players> ableToUse;
      //Getters and Setters
@实体
@表(name=“technology”)
@EntityListeners(AuditingEntityListener.class)
@JsonIdentityInfo(
生成器=ObjectedGenerators.PropertyGenerator.class,
property=“id”)
公开课技术{
@身份证
@GeneratedValue(策略=GenerationType.AUTO)
私有整数id;
@列(name=“technology\u name”)
私有字符串技术名称;
@杰索尼奥雷
@ManyToMany(mappedBy=“canUse”,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
私人名单;
//接球手和接球手

提前感谢您,ID为91的播放器出现了问题。该播放器还应打印PHP和PYTHON,但仅打印ID。

canUse将无法使用normal进行反序列化mapper@silentsudo你能澄清一下吗?对不起,我在这方面完全不在行。canUse将无法与normal进行反序列化mapper@silentsudo你能不能请克莱尔ify?对不起,我完全不知道这件事。
@Entity
@Table(name = "technique")
@EntityListeners(AuditingEntityListener.class)

@JsonIdentityInfo(
        generator = ObjectIdGenerators.PropertyGenerator.class,
        property = "id")
public class Technique {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    @Column(name = "technique_name")
    private String techniqueName;
    @JsonIgnore
    @ManyToMany(mappedBy = "canUse", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    private List<Players> ableToUse;
      //Getters and Setters