@Repository public interface ServerPackRepository extends org.springframework.data.repository.CrudRepository<ServerPackModel,java.lang.Integer>
ServerPackModels to and from our SQLite database. Provides methods for
retrieving, storing, deleting. Calls must always be made from ServerPackService and not directly
to this repository. It may seem strange, but this accomplishes a couple of things:| Modifier and Type | Method and Description |
|---|---|
int |
countAllByProjectID(int projectID)
Count all server packs by a CurseForge projectID.
|
int |
countAllByProjectName(java.lang.String projectName)
Count all server packs by a CurseForge project name.
|
void |
deleteAllByProjectID(int projectID)
Delete all server packs with a CurseForge project ID.
|
void |
deleteByProjectIDAndFileID(int projectID,
int fileID)
Delete a server pack with a given CurseForge project and file ID.
|
java.util.Optional<java.util.List<ServerPackModel>> |
findAllByProjectID(int projectID)
Find all server packs using a CurseForge project ID.
|
java.util.Optional<java.util.List<ServerPackModel>> |
findAllByProjectName(java.lang.String projectName)
Find all server packs using a CurseForge project name.
|
java.util.Optional<ServerPackModel> |
findByFileID(int fileID)
Find a server pack by its database id.
|
java.util.Optional<ServerPackModel> |
findByFileName(java.lang.String fileName)
Find a server pack by its CurseForge file display name.
|
java.util.Optional<ServerPackModel> |
findByProjectIDAndFileID(int projectID,
int fileID)
Find a specific server pack by searching with a CurseForge project and file ID.
|
java.util.Optional<java.util.List<ServerPackModel>> |
findByStatus(java.lang.String status)
Find all server packs by their status.
|
java.util.Optional<java.util.List<ServerPackModel>> findAllByProjectID(int projectID)
projectID - Integer. The CurseForge project ID with which to search for server pack.Optional. I recommend to make use of Optional.isPresent() and Optional.get().java.util.Optional<ServerPackModel> findByProjectIDAndFileID(int projectID, int fileID)
projectID - Integer. The CurseForge project ID.fileID - Integer. The CurseForge project file ID.Optional. I recommend to make use of Optional.isPresent() and Optional.get().java.util.Optional<java.util.List<ServerPackModel>> findAllByProjectName(java.lang.String projectName)
projectName - String. The project name with which to search for server packs.Optional. I recommend to make use of Optional.isPresent() and Optional.get().java.util.Optional<ServerPackModel> findByFileID(int fileID)
fileID - Integer. The database id with which to search for a server pack.Optional. I recommend to make use of Optional.isPresent() and Optional.get().java.util.Optional<ServerPackModel> findByFileName(java.lang.String fileName)
fileName - String. The CurseForge file display name with which to search for a server pack.Optional. I recommend to make use of Optional.isPresent() and Optional.get().java.util.Optional<java.util.List<ServerPackModel>> findByStatus(java.lang.String status)
status - String. The status with which to search for server packs.Optional. I recommend to make use of Optional.isPresent() and Optional.get().int countAllByProjectID(int projectID)
projectID - Integer. The CurseForge project ID with which to count all server packs.int countAllByProjectName(java.lang.String projectName)
projectName - String. The CurseForge project name with which to count all server packs.void deleteAllByProjectID(int projectID)
projectID - The CurseForge project ID for which to delete all server packs.void deleteByProjectIDAndFileID(int projectID,
int fileID)
projectID - Integer. The CurseForge project ID.fileID - Integer. The CurseForge file ID.