Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,79 +9,88 @@
import java.util.List;
import java.util.UUID;

/**
* Repository interface for managing {@link CertificateAuthorityCredential} entities in the database.
*
* <p>
* The {@link CACredentialRepository} interface extends {@link JpaRepository} to provide basic CRUD operations,
* including save, find, delete, and query methods. Custom query methods can be defined
* using Spring Data JPA's query method naming conventions or with the Query annotation.
* </p>
*/
@Repository
public interface CACredentialRepository extends JpaRepository<CertificateAuthorityCredential, UUID> {

/**
* Query that retrieves a list of certificate authority credentials using the provided archive flag.
* Query that retrieves a count of {@link CertificateAuthorityCredential} objects in the database filtered by the provided
* archive flag.
*
* @param archiveFlag archive flag
* @return a list of certificate authority credentials
* @return a count of {@link CertificateAuthorityCredential} objects
*/
List<CertificateAuthorityCredential> findByArchiveFlag(boolean archiveFlag);
Copy link
Collaborator Author

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.

long countByArchiveFlag(boolean archiveFlag);

/**
* Query that retrieves a page of certificate authority credentials using the provided archive
* flag and the provided pageable.
* Query that retrieves a page of {@link CertificateAuthorityCredential} objects filtered by the specified archive flag.
*
* @param archiveFlag archive flag
* @param pageable pageable
* @return a page of certificate authority credentials
* @return a page of {@link CertificateAuthorityCredential} objects
*/
Page<CertificateAuthorityCredential> findByArchiveFlag(boolean archiveFlag, Pageable pageable);

/**
* Query that retrieves a list of certificate authority credentials using the provided subject.
* Query that retrieves a list of {@link CertificateAuthorityCredential} objects using the provided subject.
*
* @param subject subject
* @return a list of certificate authority credentials
* @return a list of {@link CertificateAuthorityCredential} objects
*/
List<CertificateAuthorityCredential> findBySubject(String subject);

/**
* Query that retrieves a sorted list of certificate authority credentials using the provided subject.
* Query that retrieves a sorted list of {@link CertificateAuthorityCredential} objects using the provided subject.
*
* @param subject subject
* @return a sorted list of certificate authority credentials
* @return a sorted list of {@link CertificateAuthorityCredential} objects
*/
List<CertificateAuthorityCredential> findBySubjectSorted(String subject);

/**
* Query that retrieves a list of certificate authority credentials using the provided subject
* Query that retrieves a list of {@link CertificateAuthorityCredential} objects using the provided subject
* and the provided archive flag.
*
* @param subject subject
* @param archiveFlag archive flag
* @return a list of certificate authority credentials
* @return a list of {@link CertificateAuthorityCredential} objects
*/
List<CertificateAuthorityCredential> findBySubjectAndArchiveFlag(String subject, boolean archiveFlag);

/**
* Query that retrieves a sorted list of certificate authority credentials using the provided subject
* Query that retrieves a sorted list of {@link CertificateAuthorityCredential} objects using the provided subject
* and the provided archive flag.
*
* @param subject subject
* @param archiveFlag archive flag
* @return a sorted list of certificate authority credentials
* @return a sorted list of {@link CertificateAuthorityCredential} objects
*/
List<CertificateAuthorityCredential> findBySubjectSortedAndArchiveFlag(String subject,
boolean archiveFlag);

/**
* Query that retrieves a certificate authority credential using the provided subject key identifier.
* Query that retrieves a {@link CertificateAuthorityCredential} object using the provided subject key identifier.
*
* @param subjectKeyIdentifier byte array representation of the subject key identifier
* @return a certificate authority credential
* @return a {@link CertificateAuthorityCredential} object
*/
CertificateAuthorityCredential findBySubjectKeyIdentifier(byte[] subjectKeyIdentifier);

/**
* Query that retrieves a certificate authority credential using the provided subject key identifier
* Query that retrieves a {@link CertificateAuthorityCredential} object using the provided subject key identifier
* and the provided archive flag.
*
* @param subjectKeyIdString string representation of the subject key id
* @param archiveFlag archive flag
* @return a certificate authority credential
* @return a {@link CertificateAuthorityCredential} object
*/
CertificateAuthorityCredential findBySubjectKeyIdStringAndArchiveFlag(String subjectKeyIdString,
boolean archiveFlag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,49 @@
import java.util.List;
import java.util.UUID;

/**
* Repository interface for managing {@link EndorsementCredential} entities in the database.
*
* <p>
* The {@link EndorsementCredentialRepository} interface extends {@link JpaRepository} to provide basic CRUD operations,
* including save, find, delete, and query methods. Custom query methods can be defined
* using Spring Data JPA's query method naming conventions or with the Query annotation.
* </p>
*/
@Repository
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 {@link EndorsementCredential} objects in the database filtered by the
* provided archive flag.
*
* @param archiveFlag archive flag
* @return a list of endorsement credentials
* @return a count of {@link EndorsementCredential} objects
*/
List<EndorsementCredential> findByArchiveFlag(boolean archiveFlag);
Copy link
Collaborator Author

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.

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 {@link EndorsementCredential} objects filtered by the specified archive flag.
*
* @param archiveFlag archive flag
* @param pageable pageable value
* @return a page of endorsement credentials
* @return a page of {@link EndorsementCredential} objects
*/
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.
* Query that retrieves an {@link EndorsementCredential} object using the provided serial number.
*
* @param serialNumber big integer representation of the serial number
* @return an endorsement credential
* @return an {@link EndorsementCredential} object
*/
EndorsementCredential findBySerialNumber(BigInteger serialNumber);

/**
* Query that retrieves a list of endorsement credentials using the provided device id.
* Query that retrieves a list of {@link EndorsementCredential} objects using the provided device id.
*
* @param deviceId uuid representation of the device id
* @return an endorsement credential
* @return a list of {@link EndorsementCredential} objects
*/
List<EndorsementCredential> findByDeviceId(UUID deviceId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,80 +6,34 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.UUID;

/**
* Repository interface for managing {@link IDevIDCertificate} entities in the database.
*
* <p>
* The {@link IDevIDCertificateRepository} interface extends {@link JpaRepository} to provide basic CRUD operations,
* including save, find, delete, and query methods. Custom query methods can be defined
* using Spring Data JPA's query method naming conventions or with the Query annotation.
* </p>
*/
@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 {@link IDevIDCertificate} objects in the database filtered by the provided archive flag.
*
* @param archiveFlag archive flag
* @return a list of IDevId certificates
* @return a count of {@link IDevIDCertificate} objects
*/
List<IDevIDCertificate> findByArchiveFlag(boolean archiveFlag);
Copy link
Collaborator Author

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.

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 {@link IDevIDCertificate} objects filtered by the specified archive flag.
*
* @param archiveFlag archive flag
* @param pageable pageable value
* @return a page of IDevId certificates
* @return a page of {@link IDevIDCertificate} objects
*/
Page<IDevIDCertificate> findByArchiveFlag(boolean archiveFlag, Pageable pageable);


// /**
// * Query that retrieves a list of IDevId certificates using the provided subject.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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
Expand Up @@ -9,32 +9,41 @@
import java.util.List;
import java.util.UUID;

/**
* Repository interface for managing {@link IssuedAttestationCertificate} entities in the database.
*
* <p>
* The {@link IssuedCertificateRepository} interface extends {@link JpaRepository} to provide basic CRUD operations,
* including save, find, delete, and query methods. Custom query methods can be defined
* using Spring Data JPA's query method naming conventions or with the Query annotation.
* </p>
*/
@Repository
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 {@link IssuedAttestationCertificate} objects in the database filtered by the provided archive flag.
*
* @param archiveFlag archive flag
* @return a list of issued attestation certificates
* @return a count of {@link IssuedAttestationCertificate} objects
*/
List<IssuedAttestationCertificate> findByArchiveFlag(boolean archiveFlag);
Copy link
Collaborator Author

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.

long countByArchiveFlag(boolean archiveFlag);

/**
* Query that retrieves a page of issued attestation certificates using the provided archive flag
* Query that retrieves a page of {@link IssuedAttestationCertificate} objects using the provided archive flag
* and pageable value.
*
* @param archiveFlag archive flag
* @param pageable pageable value
* @return a page of issued attestation certificates
* @return a page of {@link IssuedAttestationCertificate} objects
*/
Page<IssuedAttestationCertificate> findByArchiveFlag(boolean archiveFlag, Pageable pageable);

/**
* Query that retrieves a list of issued attestation certificates using the provided device id.
* Query that retrieves a list of {@link IssuedAttestationCertificate} objects using the provided device id.
*
* @param deviceId uuid representation of the device id
* @return a list of issued attestation certificates
* @return a list of {@link IssuedAttestationCertificate} objects
*/
List<IssuedAttestationCertificate> findByDeviceId(UUID deviceId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,40 @@
import java.util.List;
import java.util.UUID;

/**
* Repository interface for managing {@link PlatformCredential} entities in the database.
*
* <p>
* The {@link PlatformCertificateRepository} interface extends {@link JpaRepository} to provide basic CRUD operations,
* including save, find, delete, and query methods. Custom query methods can be defined
* using Spring Data JPA's query method naming conventions or with the Query annotation.
* </p>
*/
@Repository
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 {@link PlatformCredential} objects in the database filtered by the provided archive flag.
*
* @param archiveFlag archive flag
* @return a list of platform credentials
* @return a count of {@link PlatformCredential} objects
*/
List<PlatformCredential> findByArchiveFlag(boolean archiveFlag);
Copy link
Collaborator Author

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.

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 {@link PlatformCredential} objects filtered by the specified archive flag.
*
* @param archiveFlag archive flag
* @param pageable pageable
* @return a page of platform credentials
* @return a page of {@link PlatformCredential} objects
*/
Page<PlatformCredential> findByArchiveFlag(boolean archiveFlag, Pageable pageable);

/**
* Query that retrieves a list of platform credentials using the provided device id.
* Query that retrieves a list of {@link PlatformCredential} objects using the provided device id.
*
* @param deviceId uuid representation of the device id
* @return a list of platform credentials
* @return a list of {@link PlatformCredential} objects
*/
List<PlatformCredential> findByDeviceId(UUID deviceId);
}
Loading
Loading