• Restful规则及JPA导致内存溢出


    HTTP动词

    对于资源的具体操作类型,由HTTP动词表示。
    常用的HTTP动词有下面五个(括号里是对应的SQL命令)。

    GET(SELECT):从服务器取出资源(一项或多项)。
    POST(CREATE):在服务器新建一个资源。
    PUT(UPDATE):在服务器更新资源(客户端提供改变后的完整资源)。
    PATCH(UPDATE):在服务器更新资源(客户端提供改变的属性)。
    DELETE(DELETE):从服务器删除资源。
    

    还有两个不常用的HTTP动词。

    HEAD:获取资源的元数据。
    OPTIONS:获取信息,关于资源的哪些属性是客户端可以改变的。
    

    下面是一些例子。

    GET /zoos:列出所有动物园
    POST /zoos:新建一个动物园
    GET /zoos/ID:获取某个指定动物园的信息
    PUT /zoos/ID:更新某个指定动物园的信息(提供该动物园的全部信息)
    PATCH /zoos/ID:更新某个指定动物园的信息(提供该动物园的部分信息)
    DELETE /zoos/ID:删除某个动物园
    GET /zoos/ID/animals:列出某个指定动物园的所有动物
    DELETE /zoos/ID/animals/ID:删除某个指定动物园的指定动物
    

    fixed 内存溢出

    代码

    @Setter
    @Getter
    @Entity
    @Table(name = "tb_zoo")
    public class Zoo {
    
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Long id;
        @NotBlank
        private String name;
        private String address;
        private String url;
        @OneToMany(mappedBy = "zoo")
        private List<Animal> animalList;
    }
    
    @Setter
    @Getter
    @Entity
    @Table(name = "tb_animal")
    public class Animal {
    
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Long id;
    
        @NotBlank
        private String name;
    
        @NotBlank
        private String kind;
    
        @ManyToOne
        private Zoo zoo;
    }
    

    调用GET /zoos/{id}/animals 时, 会出现内存溢出。

    Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Infinite recursion (StackOverflowError); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"]->org.hibernate.collection.internal.PersistentBag[0]->com.chinda.entity.Animal["zoo"]->com.chinda.entity.Zoo["animalList"])] with root cause
    

    出现此情况是因为转换json时会递归转换, 最终导致内存溢出。
    解决方案: 忽略掉一方的json转换即可。
    修复后代码:

    @Setter
    @Getter
    @Entity
    @Table(name = "tb_animal")
    public class Animal {
    
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Long id;
    
        @NotBlank
        private String name;
    
        @NotBlank
        private String kind;
    
        @JsonIgnore
        @ManyToOne
        private Zoo zoo;
    }
    

    码云

    https://gitee.com/w_chinda/restful-api

  • 相关阅读:
    设置IIS允许下载.config文件
    SQL Server 触发器
    MVC参数自动装配
    sql之left join、right join、inner join的区别
    C# 之泛型详解
    Frameset使用教程
    网页引用Font Awesome图标
    ubuntu下apache2 安装 配置 卸载 CGI设置 SSL设置
    深入理解JAVA I/O系列二:字节流详解
    深入理解JAVA I/O系列三:字符流详解
  • 原文地址:https://www.cnblogs.com/chinda/p/13431686.html
Copyright © 2020-2023  润新知