-
Notifications
You must be signed in to change notification settings - Fork 62
[#1143] Table Data Should Be Sorted Chronologically By Default #1144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
b89d16e
9d5c374
c6afc57
a2379bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,30 +14,22 @@ | |
| public interface EndorsementCredentialRepository extends JpaRepository<EndorsementCredential, UUID> { | ||
|
|
||
| /** | ||
| * Query that retrieves a list of endorsement credentials using the provided archive flag. | ||
| * Query that retrieves a count of endorsement credentials in the database filtered by the provided archive flag. | ||
| * | ||
| * @param archiveFlag archive flag | ||
| * @return a list of endorsement credentials | ||
| * @return a count of endorsement credentials | ||
| */ | ||
| List<EndorsementCredential> findByArchiveFlag(boolean archiveFlag); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method was originally used to retrieve all entries from the repository and then count them using .size(). Since its only purpose was to get the total number of entries, it was replaced with countBy…, which performs a direct count query in the database, making it more efficient. |
||
| long countByArchiveFlag(boolean archiveFlag); | ||
|
|
||
| /** | ||
| * Query that retrieves a page of endorsement credentials using provided archive flag and pageable value. | ||
| * Query that retrieves a page of endorsement credentials filtered by the specified archive flag. | ||
| * | ||
| * @param archiveFlag archive flag | ||
| * @param pageable pageable value | ||
| * @return a page of endorsement credentials | ||
| */ | ||
| Page<EndorsementCredential> findByArchiveFlag(boolean archiveFlag, Pageable pageable); | ||
|
|
||
| /** | ||
| * Query that retrieves an endorsement credential using the provided holder serial number. | ||
| * | ||
| * @param holderSerialNumber big integer representation of the holder serial number | ||
| * @return an endorsement credential | ||
| */ | ||
| EndorsementCredential findByHolderSerialNumber(BigInteger holderSerialNumber); | ||
|
|
||
| /** | ||
| * Query that retrieves an endorsement credential using the provided serial number. | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,80 +6,25 @@ | |
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| @Repository | ||
| public interface IDevIDCertificateRepository extends JpaRepository<IDevIDCertificate, UUID> { | ||
|
|
||
| /** | ||
| * Query that retrieves a list of IDevId certificates using the provided archive flag. | ||
| * Query that retrieves a count of IDevId certificates in the database filtered by the provided archive flag. | ||
| * | ||
| * @param archiveFlag archive flag | ||
| * @return a list of IDevId certificates | ||
| * @return a count of idevid certificates | ||
| */ | ||
| List<IDevIDCertificate> findByArchiveFlag(boolean archiveFlag); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method was originally used to retrieve all entries from the repository and then count them using .size(). Since its only purpose was to get the total number of entries, it was replaced with countBy…, which performs a direct count query in the database, making it more efficient. |
||
| long countByArchiveFlag(boolean archiveFlag); | ||
|
|
||
| /** | ||
| * Query that retrieves a page of IDevId certificates using the provided archive flag and pageable value. | ||
| * Query that retrieves a page of IDevId certificates filtered by the specified archive flag. | ||
| * | ||
| * @param archiveFlag archive flag | ||
| * @param pageable pageable value | ||
| * @return a page of IDevId certificates | ||
| */ | ||
| Page<IDevIDCertificate> findByArchiveFlag(boolean archiveFlag, Pageable pageable); | ||
|
|
||
|
|
||
| // /** | ||
| // * Query that retrieves a list of IDevId certificates using the provided subject. | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed unused repository methods. |
||
| // * | ||
| // * @param subject string representation of the subject | ||
| // * @return a list of IDevId certificates | ||
| // */ | ||
| // List<IDevIDCertificate> findBySubject(String subject); | ||
| // | ||
| // /** | ||
| // * Query that retrieves a sorted list of IDevId certificates using the provided subject. | ||
| // * | ||
| // * @param subject string representation of the subject | ||
| // * @return a sorted list of IDevId certificates | ||
| // */ | ||
| // List<IDevIDCertificate> findBySubjectSorted(String subject); | ||
| // | ||
| // /** | ||
| // * Query that retrieves a list of IDevId certificates using the provided subject and archive flag. | ||
| // * | ||
| // * @param subject string representation of the subject | ||
| // * @param archiveFlag archive flag | ||
| // * @return a list of IDevId certificates | ||
| // */ | ||
| // List<IDevIDCertificate> findBySubjectAndArchiveFlag(String subject, boolean archiveFlag); | ||
| // | ||
| // /** | ||
| // * Query that retrieves a sorted list of IDevId certificates using the provided subject | ||
| // * and archive flag. | ||
| // * | ||
| // * @param subject string representation of the subject | ||
| // * @param archiveFlag archive flag | ||
| // * @return a sorted list of IDevId certificates | ||
| // */ | ||
| // List<IDevIDCertificate> findBySubjectSortedAndArchiveFlag(String subject, boolean archiveFlag); | ||
| // | ||
| // /** | ||
| // * Query that retrieves an IDevId certificate using the provided subject key identifier. | ||
| // * | ||
| // * @param subjectKeyIdentifier byte representation of the subject key identifier | ||
| // * @return an IDevId certificate | ||
| // */ | ||
| // IDevIDCertificate findBySubjectKeyIdentifier(byte[] subjectKeyIdentifier); | ||
| // | ||
| // /** | ||
| // * Query that retrieves an IDevId certificate using the provided subject key and archive flag. | ||
| // * | ||
| // * @param subjectKeyIdString string representation of the subject key id | ||
| // * @param archiveFlag archive flag | ||
| // * @return an IDevId certificate | ||
| // */ | ||
| // IDevIDCertificate findBySubjectKeyIdStringAndArchiveFlag(String subjectKeyIdString, | ||
| // boolean archiveFlag); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,12 +13,12 @@ | |
| public interface IssuedCertificateRepository extends JpaRepository<IssuedAttestationCertificate, UUID> { | ||
|
|
||
| /** | ||
| * Query that retrieves a list of issued attestation certificates using the provided archive flag. | ||
| * Query that retrieves a count of issued certificates in the database filtered by the provided archive flag. | ||
| * | ||
| * @param archiveFlag archive flag | ||
| * @return a list of issued attestation certificates | ||
| * @return a count of issued certificates | ||
| */ | ||
| List<IssuedAttestationCertificate> findByArchiveFlag(boolean archiveFlag); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method was originally used to retrieve all entries from the repository and then count them using .size(). Since its only purpose was to get the total number of entries, it was replaced with countBy…, which performs a direct count query in the database, making it more efficient. |
||
| long countByArchiveFlag(boolean archiveFlag); | ||
|
|
||
| /** | ||
| * Query that retrieves a page of issued attestation certificates using the provided archive flag | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,16 +13,15 @@ | |
| public interface PlatformCertificateRepository extends JpaRepository<PlatformCredential, UUID> { | ||
|
|
||
| /** | ||
| * Query that retrieves a list of platform credentials using the provided archive flag. | ||
| * Query that retrieves a count of platform credentials in the database filtered by the provided archive flag. | ||
| * | ||
| * @param archiveFlag archive flag | ||
| * @return a list of platform credentials | ||
| * @return a count of platform credentials | ||
| */ | ||
| List<PlatformCredential> findByArchiveFlag(boolean archiveFlag); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method was originally used to retrieve all entries from the repository and then count them using .size(). Since its only purpose was to get the total number of entries, it was replaced with countBy…, which performs a direct count query in the database, making it more efficient. |
||
| long countByArchiveFlag(boolean archiveFlag); | ||
|
|
||
| /** | ||
| * Query that retrieves a page of platform credentials using the provided archive flag | ||
| * and pageable value. | ||
| * Query that retrieves a page of platform credentials filtered by the specified archive flag. | ||
| * | ||
| * @param archiveFlag archive flag | ||
| * @param pageable pageable | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,20 +219,19 @@ public interface ReferenceManifestRepository extends JpaRepository<ReferenceMani | |
| List<ReferenceManifest> findByArchiveFlag(boolean archiveFlag); | ||
|
|
||
| /** | ||
| * Query that retrieves a page of reference manifests using the provided archive flag and pageable value. | ||
| * Query that retrieves a count of reference manifests in the database filtered by the provided archive flag. | ||
| * | ||
| * @param archiveFlag archive flag | ||
| * @param pageable pageable | ||
| * @return a page of reference manifests | ||
| * @return a count of reference manifests | ||
| */ | ||
| Page<ReferenceManifest> findByArchiveFlag(boolean archiveFlag, Pageable pageable); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method was originally used to retrieve all entries from the repository and then count them using .size(). Since its only purpose was to get the total number of entries, it was replaced with countBy…, which performs a direct count query in the database, making it more efficient. |
||
| long countByArchiveFlag(boolean archiveFlag); | ||
|
|
||
| /** | ||
| * Query that retrieves a page of base and support reference manifests and pageable value. | ||
| * Retrieves a paginated list of {@link ReferenceManifest} instances matching the specified subclass types. | ||
| * | ||
| * @param types the list of {@link ReferenceManifest} subclass types to include | ||
| * @param pageable pageable | ||
| * @return a page of reference manifests | ||
| * @return a page of matching {@link ReferenceManifest} instances | ||
| */ | ||
| @Query(value = "SELECT * FROM ReferenceManifest WHERE DTYPE IN " | ||
| + "('BaseReferenceManifest', 'SupportReferenceManifest')", nativeQuery = true) | ||
| Page<ReferenceManifest> findAllBaseAndSupportRimsPageable(Pageable pageable); | ||
| Page<ReferenceManifest> findByClassIn(List<Class<? extends ReferenceManifest>> types, Pageable pageable); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,15 @@ | ||
| package hirs.attestationca.persist.entity.manager; | ||
|
|
||
| import hirs.attestationca.persist.entity.userdefined.Device; | ||
| import hirs.attestationca.persist.entity.userdefined.SupplyChainValidationSummary; | ||
| import org.springframework.data.domain.Page; | ||
| import org.springframework.data.domain.Pageable; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| @Repository | ||
| public interface SupplyChainValidationSummaryRepository | ||
| extends JpaRepository<SupplyChainValidationSummary, UUID> { | ||
|
|
||
| /** | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed unused methods. |
||
| * Query that retrieves a supply chain validation summary using the provided device. | ||
| * | ||
| * @param device device | ||
| * @return a supply chain validation summary | ||
| */ | ||
| SupplyChainValidationSummary findByDevice(Device device); | ||
|
|
||
| /** | ||
| * Query that retrieves a list of supply chain validation summaries where the archive flag is false. | ||
| * | ||
| * @return a list of supply chain validation summary | ||
| */ | ||
| List<SupplyChainValidationSummary> findByArchiveFlagFalse(); | ||
| public interface SupplyChainValidationSummaryRepository extends JpaRepository<SupplyChainValidationSummary, UUID> { | ||
|
|
||
| /** | ||
| * Query that retrieves a page of supply chain validation summaries using the provided pageable value | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was originally used to retrieve all entries from the repository and then count them using .size(). Since its only purpose was to get the total number of entries, it was replaced with countBy…, which performs a direct count query in the database, making it more efficient.