たとえば、この関係をマッピングしています。
@Entity
@Table(name = "shop")
public class Shop implements Serializable {
...
@OneToMany(mappedBy = "shop", fetch=FetchType.LAZY)
private Set<Event> events;
...
}
@Entity
@Table(name = "event")
public class Event implements Serializable {
...
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "shop_id", nullable = false)
private Shop shop;
...
}
When Local getEvent() is called is loaded in Colletion one list with a few Events, but each Event have inside another Shop might have inside another Event and successively.. Is that ok?. Can do any problem responsing JSON structure?