I have One-To-Many relationship, here is my code
@Entity
@Table(name = \"catalog\")
public class Catalog {
@Id
@GeneratedValue(strategy = GenerationType
I know this is an old post but this might still help someone facing a similar issue. To solve the problem, iterate through the list of items and set the lazy-loadable collection to null. Then set your mapper to include NON-NULL
for (Catalog c : allCatalogs) {
c.setItems(null);
}
objectMapper.setSerializationInclusion(Include.NON_NULL)