These are fixes for issues found via unit test that are in PR #652. But

that PR is currently still WIP and these changes have nothing to do with
why that PR is WIP.  Therefore PR just covers these changes to the
creation time not being saved/reset.
This commit is contained in:
Cyrus 2023-12-20 15:15:27 -05:00
parent a30b81a68e
commit b52128a0b1
3 changed files with 4 additions and 7 deletions

View File

@ -7,9 +7,6 @@ import jakarta.persistence.MappedSuperclass;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;
import org.hibernate.annotations.UuidGenerator;
import java.io.Serializable;
@ -38,9 +35,7 @@ public abstract class AbstractEntity implements Serializable {
private UUID id;
@Column (name = "create_time")
@ColumnDefault(value = "CURRENT_TIMESTAMP")
@Generated(GenerationTime.INSERT)
private Date createTime = new Date();
private Date createTime;
/**
* Default empty constructor is required for Hibernate. It is protected to
@ -48,6 +43,7 @@ public abstract class AbstractEntity implements Serializable {
*/
protected AbstractEntity() {
super();
createTime = new Date();
}
/**

View File

@ -16,5 +16,6 @@ public interface EndorsementCredentialRepository extends JpaRepository<Endorseme
List<EndorsementCredential> findByArchiveFlag(boolean archiveFlag);
Page<EndorsementCredential> findByArchiveFlag(boolean archiveFlag, Pageable pageable);
EndorsementCredential findByHolderSerialNumber(BigInteger holderSerialNumber);
EndorsementCredential findBySerialNumber(BigInteger serialNumber);
List<EndorsementCredential> findByDeviceId(UUID deviceId);
}

View File

@ -253,7 +253,7 @@ public class CertificatePageController extends PageController<NoPageParams> {
PlatformCredential pc = (PlatformCredential) records.get(i);
// find the EC using the PC's "holder serial number"
associatedEC = this.endorsementCredentialRepository
.findByHolderSerialNumber(pc.getHolderSerialNumber());
.findBySerialNumber(pc.getHolderSerialNumber());
if (associatedEC != null) {
log.debug("EC ID for holder s/n " + pc