Class ChallengeDao
java.lang.Object
me.nickhanson.codeforge.persistence.ChallengeDao
Data Access Object (DAO) for the Challenge entity.
Provides methods to perform CRUD operations and custom queries on Challenge entities.
- Author:
- Nick Hanson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanexistsTitleForOtherIgnoreCase(String title, Long excludeId) Checks if a challenge with the given title exists, ignoring case, excluding a specific challenge by its ID.booleanexistsTitleIgnoreCase(String title) Checks if a challenge with the given title exists, ignoring case.findByDifficulty(Difficulty difficulty) Finds challenges by their difficulty level.findByTitle(String title) Finds challenges by their title.getAll()voidsaveOrUpdate(Challenge challenge)
-
Constructor Details
-
ChallengeDao
public ChallengeDao()
-
-
Method Details
-
getById
-
getAll
-
saveOrUpdate
-
delete
-
findByTitle
Finds challenges by their title.- Parameters:
title- The title of the challenge to search for.- Returns:
- A list of challenges matching the given title.
-
findByDifficulty
Finds challenges by their difficulty level.- Parameters:
difficulty- The difficulty level to search for.- Returns:
- A list of challenges matching the given difficulty level.
-
existsTitleIgnoreCase
Checks if a challenge with the given title exists, ignoring case.- Parameters:
title- The title to check for existence.- Returns:
- True if a challenge with the given title exists, false otherwise.
-
existsTitleForOtherIgnoreCase
Checks if a challenge with the given title exists, ignoring case, excluding a specific challenge by its ID.- Parameters:
title- The title to check for existence.excludeId- The ID of the challenge to exclude from the check.- Returns:
- True if a challenge with the given title exists (excluding the specified ID), false otherwise.
-