I am getting an java.sql.SQLSyntaxErrorException: ORA-00900: Invalid SQL Statement
after moving the @Transactional
and @Modifying
annotations from the my repository methods to the service methods :
@Repository("someRepository")
public interface SomeRepository extends CrudRepository<SomeEntity, String>{
//My code works if the next two line are uncommented !!
//@Transactional
//@Modifying
@Query(nativeQuery = true, value = "delete from some_table where col = :param")
int repoDelete(@Param("param") String param);
}
@Service(value = "someService")
public class SomeServiceImpl implements SomeService {
@Autowired SomeRepository repo;
@Override
@Transactional
@Modifying
public void serviceDelete(String id) throws UdhException {
repo.repoDelete(id);
}
}