Java 冬眠一个一个一个的循环?

Java 冬眠一个一个一个的循环?,java,hibernate,many-to-one,hibernate-annotations,hibernate-onetomany,Java,Hibernate,Many To One,Hibernate Annotations,Hibernate Onetomany,我不熟悉hibernate,我使用注释 这是我的两张桌子: 这是我的桌子“人物” 这是我的第二张桌子“身份识别” @实体 @表(name=“tipoidenticacion”) 公共类TipoIdentification实现java.io.Serializable{ @身份证 @GeneratedValue(策略=GenerationType.IDENTITY) @列(name=“codigo”,unique=true,nullable=false) 私人int codigo; @列(name

我不熟悉hibernate,我使用注释

这是我的两张桌子:

这是我的桌子“人物”

这是我的第二张桌子“身份识别”

@实体
@表(name=“tipoidenticacion”)
公共类TipoIdentification实现java.io.Serializable{
@身份证
@GeneratedValue(策略=GenerationType.IDENTITY)
@列(name=“codigo”,unique=true,nullable=false)
私人int codigo;
@列(name=“nombre”,nullable=false)
私有字符串名称;
@列(name=“siglas”,nullable=false)
私有字符串siglas;
@OneToMany(fetch=FetchType.LAZY,mappedBy=“tipoidenticacion”)
私有集角色=新哈希集(0);
“Persona”的主键是“codigo”,而“TipoIdentificacion”的主键是“codigo”,其中FK来自Persona(codTipoIdent)

一切看起来都很好,而且我在我的web应用程序中制作了一个crud非常好,但是当我调试它以请求一个“TipoIdentificIcon”列表时,它看起来像


这是一个循环,为什么?

你有两辆车。车主是你。你有两辆车。车主是你。你有两辆车……当你有一个双向关联时,这完全是意料之中的。是的,我现在知道更多,谢谢=)我很感激。
 @Entity
@Table(name = "persona")
public class Persona implements java.io.Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "codigo", unique = true, nullable = false)
    private int codigo;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "codTipoIdent", nullable = false)
    private TipoIdentificacion tipoIdentificacion;

    ....
@Entity
@Table(name = "tipoIdentificacion")
public class TipoIdentificacion implements java.io.Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "codigo", unique = true, nullable = false)
    private int codigo;

    @Column(name = "nombre", nullable = false)
    private String nombre;

    @Column(name = "siglas", nullable = false)
    private String siglas;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "tipoIdentificacion")    
    private Set<Persona> persona = new HashSet<Persona>(0);