I am trying to delete a row by using deleteById method of CrudRepository and It is not working/deleting the row. I enabled the hibernate log to see the generated queries by hibernate. For deleteById method :- It is only generating select query but not the delete query. anyone ever encountered this issue ? I also tried different dervied delete method. It's same response from Hibernate. But for different method like find it is working fine and generating the select query.is I am missing anything fundamental here?
My Entity Class:-
@Entity
public class Application {
@Id
@GeneratedValue
private Long id;
@OneToOne(cascade = {CascadeType.ALL}, orphanRemoval = true)
private Employee employee;
@OneToOne(cascade = {CascadeType.ALL}, orphanRemoval = true)
private Employer employer;
@OneToOne(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER, orphanRemoval = true)
private Data data;
@OneToOne
@PrimaryKeyJoinColumn
private Reports reports;
//Getter & Setters
}
My Application Repository :-
@Repository
public interface ApplicationRepository extends JpaRepository<Application, Long> {
}
My Application Service method :-
@Transactional
public void deleteApplicationData(Long applicationId) {
applicationRepo.deleteById(applicationId);
}