Package com.coachconnect.repository
Class SessionRepository
java.lang.Object
com.coachconnect.repository.SessionRepository
Repository for accessing session data from the database.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteById(String id) Deletes a session by its ID.booleanexistsById(String id) Checks if a session exists by its ID.findAll()Finds a session by its ID.findByUserId(String userId) Finds all sessions.Saves a new session.Updates an existing session.
-
Constructor Details
-
SessionRepository
-
SessionRepository
public SessionRepository()
-
-
Method Details
-
findByUserId
Finds all sessions.- Returns:
- A Result containing the list of sessions or an error message
-
findAll
-
findById
Finds a session by its ID.- Parameters:
id- The session ID- Returns:
- A Result containing the session or an error message
-
save
Saves a new session.- Parameters:
session- The session to save- Returns:
- A Result containing the saved session or an error message
-
update
Updates an existing session.- Parameters:
session- The session to update- Returns:
- A Result containing the updated session or an error message
-
deleteById
Deletes a session by its ID.- Parameters:
id- The session ID- Returns:
- A Result containing a success message or an error message
-
existsById
Checks if a session exists by its ID.- Parameters:
id- The session ID- Returns:
- true if the session exists, false otherwise
-