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.voiddeleteById(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:GenericDaoRetrieves an entity by its identifier.- Specified by:
findByIdin 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:GenericDaoRetrieves all entities of type T.- Specified by:
findAllin interfaceGenericDao<Warning,UUID> - Returns:
- a list of all entities of type T.
-
create
Description copied from interface:GenericDaoCreates and saves a new entity.- Specified by:
createin 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:GenericDaoUpdates an existing entity.- Specified by:
updatein interfaceGenericDao<Warning,UUID> - Parameters:
entity- the entity to update.- Returns:
- the updated entity.
-
deleteById
Description copied from interface:GenericDaoDeletes the entity with the given identifier.- Specified by:
deleteByIdin 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.
-