Class BaseService

java.lang.Object
balu.pizza.webapp.services.BaseService

@Service @Transactional(readOnly=true) public class BaseService extends Object
Service layer of the project for the Base entity
  • Constructor Details

    • BaseService

      @Autowired public BaseService(BaseRepository baseRepository)
      Implementing the repository layer to interact with the database
      Parameters:
      baseRepository - Base Repository
  • Method Details

    • findByName

      public Optional<Base> findByName(String name)
      Base search method by name
      Parameters:
      name -
      Returns:
      An object that may contain a Base or be empty
    • create

      @Transactional public Base create(Base base)
      Create new Base
      Parameters:
      base -
      Returns:
      new Base from DB
    • findAll

      public List<Base> findAll()
      Returns:
      List of all Bases from DB
    • findAllSorted

      public List<Base> findAllSorted()
      Returns:
      Sorted by name list of all Bases from DB
    • findById

      public Base findById(int baseId)
      Find base by ID
      Parameters:
      baseId -
      Returns:
      Base or throw NotFoundException
    • update

      @Transactional public Base update(Base base)
      Update Base in DB
      Parameters:
      base -
      Returns:
      updated Base