I have a "branche" that have many "categories" :
@JsonProperty
@OneToMany(
cascade = CascadeType.ALL
)
@JoinColumn(name="categorie_id")
@LazyCollection(LazyCollectionOption.FALSE)
private Collection<Categorie> categorie=new ArrayList<>();
@JsonProperty
@ManyToOne
@JoinColumn(name="branche_id")
private Branche branche;
I want to list the categories with the branche associated ! this works fine but i think its not written well. I don't want to use mapped By on the @OneToMany , when i use it , my list of categories does no longer contain the "branche" associated .