Interface BudgetRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Budget,Long>, org.springframework.data.repository.Repository<Budget,Long>

public interface BudgetRepository extends org.springframework.data.repository.CrudRepository<Budget,Long>
A repository for the Budget entity and extends the CrudRepository. It provides methods to update Budget's start date, end date, and boundary.
Since:
16.04.2023
Version:
16.04.2023
Author:
Group19
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    updateBudget(long bid, LocalDate startdate, LocalDate enddate, int boundary)
    Updates a Budget's start date, end date, and boundary based on its ID.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
  • Method Details

    • updateBudget

      @Transactional @Modifying @Query(value="update budget b set b.start_date = ?2, b.end_date = ?3, b.boundary = ?4 where b.bid = ?1", nativeQuery=true) void updateBudget(long bid, LocalDate startdate, LocalDate enddate, int boundary)
      Updates a Budget's start date, end date, and boundary based on its ID.
      Parameters:
      bid - the ID of the Budget to be updated
      startdate - the new start date for the Budget
      enddate - the new end date for the Budget
      boundary - the new boundary for the Budget