mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-07 11:26:51 +00:00
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:
parent
a30b81a68e
commit
b52128a0b1
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user