Package tk.airshipcraft.commonlib.db.dao
Interface WarningDao
- All Superinterfaces:
GenericDao<Warning,
UUID>
- All Known Implementing Classes:
SqlWarningDao
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 Summary
Modifier and TypeMethodDescriptionCreates and saves a new entity.void
deleteById
(UUID id) Deletes the entity with the given identifier.findAll()
Retrieves all entities of type T.Retrieves an entity by its identifier.findByUser
(UUID minecraftId, String discordId) Retrieves all warnings issued to a specific Minecraft or Discord user.Updates an existing entity.
-
Method Details
-
findById
Description copied from interface:GenericDao
Retrieves an entity by its identifier.- Specified by:
findById
in interfaceGenericDao<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
Description copied from interface:GenericDao
Retrieves all entities of type T.- Specified by:
findAll
in interfaceGenericDao<Warning,
UUID> - Returns:
- a list of all entities of type T.
-
create
Description copied from interface:GenericDao
Creates and saves a new entity.- Specified by:
create
in interfaceGenericDao<Warning,
UUID> - Parameters:
entity
- the entity to be saved.- Returns:
- the saved entity, now persisted in the data store.
-
update
Description copied from interface:GenericDao
Updates an existing entity.- Specified by:
update
in interfaceGenericDao<Warning,
UUID> - Parameters:
entity
- the entity to update.- Returns:
- the updated entity.
-
deleteById
Description copied from interface:GenericDao
Deletes the entity with the given identifier.- Specified by:
deleteById
in interfaceGenericDao<Warning,
UUID> - Parameters:
id
- the identifier of the entity to delete.
-
findByUser
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.
-