I'm using SpringBoot, when a repository is called for the AModel, the repository is executing queries for BModel, CModel and DModel even when I am not calling for either CModel or DModel. any idea why this is happening and how I can prevent it?
@Entity
public class AModel extends Model {
@OneToOne(fetch = FetchType.EAGER)
@JsonIgnore
private BModel;
}
@Entity
public class BModel extends Model {
@OneToOne(fetch = FetchType.LAZY)
private CModel;
@OneToOne(fetch = FetchType.LAZY)
private DModel;
}
@Query("select a from com.project.models.AModel a where a.id = :id")
@Override
Candidate findOne(@Param("id")Long id);