Try this:
public interface LimitRepository extends JpaRepository<CLimit, Long> {
@Modifying
@Query("delete from CLimit l where l.trader.id =:#{#trader.id}")
void deleteLimitsByTrader(@Param("trader") CTrader trader);
}
Whenever you are trying to modify a record in db, you have to mark it as @Modifying, which instruct Spring that it can modify existing records.
The modifying queries can only use void or int/Integer as return type, otherwise it will throw an exception.