Class DrillItemDao
java.lang.Object
me.nickhanson.codeforge.persistence.DrillItemDao
DAO for DrillItem entity.
Provides generic CRUD operations and entity-specific queries.
- Author:
- Nick Hanson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbulkReschedule(List<Long> ids, Instant nextDueAt) Bulk reschedule DrillItems by setting their nextDueAt to the specified time.longCount of DrillItems that are due at or before the specified time.longCount of DrillItems that are due at or before the specified time for a specific user.voidList all DrillItems that are due at or before the specified time.List all DrillItems that are due at or before the specified time for a specific user.List of due DrillItems up to the specified limit, ordered by nextDueAt.User-scoped due queue up to the specified limit, ordered by nextDueAt.getAll()listByChallengeId(Long challengeId) List all DrillItems for a given Challenge ID, ordered by nextDueAt ascending.listByChallengeIdAndUser(Long challengeId, String userId) List all DrillItems for a given Challenge ID and user, ordered by nextDueAt ascending.voidsaveOrUpdate(DrillItem item) Find the DrillItem with the soonest upcoming nextDueAt.soonestUpcoming(String userId) Find the soonest upcoming DrillItem for a user.
-
Constructor Details
-
DrillItemDao
public DrillItemDao()
-
-
Method Details
-
getById
-
getAll
-
saveOrUpdate
-
delete
-
listByChallengeId
List all DrillItems for a given Challenge ID, ordered by nextDueAt ascending.- Parameters:
challengeId- the ID of the Challenge- Returns:
- list of DrillItems associated with the Challenge
-
dueNow
List all DrillItems that are due at or before the specified time.- Parameters:
now- the cutoff Instant for due items- Returns:
- list of due DrillItems
-
countDue
Count of DrillItems that are due at or before the specified time.- Parameters:
now- the cutoff Instant for due items- Returns:
- count of due DrillItems
-
bulkReschedule
Bulk reschedule DrillItems by setting their nextDueAt to the specified time.- Parameters:
ids- list of DrillItem IDs to reschedulenextDueAt- the new nextDueAt Instant- Returns:
- number of items updated
-
dueQueue
List of due DrillItems up to the specified limit, ordered by nextDueAt.- Parameters:
now- the cutoff Instant for due itemslimit- maximum number of items to return- Returns:
- list of due DrillItems
-
soonestUpcoming
Find the DrillItem with the soonest upcoming nextDueAt.- Returns:
- Optional containing the soonest upcoming DrillItem, or empty if none exist
-
listByChallengeIdAndUser
List all DrillItems for a given Challenge ID and user, ordered by nextDueAt ascending.- Parameters:
challengeId- the ID of the ChallengeuserId- the ID of the User- Returns:
- list of DrillItems associated with the Challenge and User
-
dueNow
List all DrillItems that are due at or before the specified time for a specific user.- Parameters:
now- the cutoff Instant for due itemsuserId- the ID of the User- Returns:
- list of due DrillItems for the User
-
countDue
Count of DrillItems that are due at or before the specified time for a specific user.- Parameters:
now- the cutoff Instant for due itemsuserId- the ID of the User- Returns:
- count of due DrillItems for the User
-
dueQueue
User-scoped due queue up to the specified limit, ordered by nextDueAt.- Parameters:
now- the cutoff Instant for due itemslimit- maximum number of items to returnuserId- the ID of the User- Returns:
- list of due DrillItems for the User
-
soonestUpcoming
Find the soonest upcoming DrillItem for a user.- Parameters:
userId- the ID of the User- Returns:
- Optional containing the soonest upcoming DrillItem for the User, or empty if none exist
-