i use Hibernate 4 and Spring 3.
i have two entity.
Book entity
@Entity @Table(name = \"book\") public class Book implements Serializable {
You can use @com.fasterxml.jackson.annotation.JsonIgnore annotation to avoid a field to be serialized. Thus the getter of that field won't get called.
@com.fasterxml.jackson.annotation.JsonIgnore
@JsonIgnore @OneToMany( mappedBy = "author", cascade = CascadeType.ALL, orphanRemoval = true) private Set books = new HashSet();