Interface WarningDao

All Superinterfaces:
GenericDao<Warning,UUID>
All Known Implementing Classes:
SqlWarningDao

public interface WarningDao extends GenericDao<Warning,UUID>
The WarningDao interface defines the data access methods for Warning objects. Extends GenericDao to provide standard CRUD operations for Warning entities.
Since:
2024-01-06
Version:
1.0.0
Author:
notzune
  • Method Details

    • findById

      Optional<Warning> findById(UUID id)
      Description copied from interface: GenericDao
      Retrieves an entity by its identifier.
      Specified by:
      findById in interface GenericDao<Warning,UUID>
      Parameters:
      id - the entity's identifier.
      Returns:
      an Optional containing the found entity or an empty Optional if no entity is found.
    • findAll

      List<Warning> findAll()
      Description copied from interface: GenericDao
      Retrieves all entities of type T.
      Specified by:
      findAll in interface GenericDao<Warning,UUID>
      Returns:
      a list of all entities of type T.
    • create

      Warning create(Warning entity)
      Description copied from interface: GenericDao
      Creates and saves a new entity.
      Specified by:
      create in interface GenericDao<Warning,UUID>
      Parameters:
      entity - the entity to be saved.
      Returns:
      the saved entity, now persisted in the data store.
    • update

      Warning update(Warning entity)
      Description copied from interface: GenericDao
      Updates an existing entity.
      Specified by:
      update in interface GenericDao<Warning,UUID>
      Parameters:
      entity - the entity to update.
      Returns:
      the updated entity.
    • deleteById

      void deleteById(UUID id)
      Description copied from interface: GenericDao
      Deletes the entity with the given identifier.
      Specified by:
      deleteById in interface GenericDao<Warning,UUID>
      Parameters:
      id - the identifier of the entity to delete.
    • findByUser

      List<Warning> findByUser(UUID minecraftId, String discordId)
      Retrieves all warnings issued to a specific Minecraft or Discord user.
      Parameters:
      minecraftId - The UUID of the Minecraft user.
      discordId - The Discord ID of the user.
      Returns:
      A List of Warning objects.