|
| 1 | +/** |
| 2 | +* Copyright Reliza Incorporated. 2019 - 2025. Licensed under the terms of AGPL-3.0-only. |
| 3 | +*/ |
| 4 | + |
| 5 | +package io.reliza.model; |
| 6 | + |
| 7 | +import java.io.Serializable; |
| 8 | +import java.time.ZonedDateTime; |
| 9 | +import java.util.Map; |
| 10 | +import java.util.UUID; |
| 11 | + |
| 12 | +import jakarta.persistence.Column; |
| 13 | +import jakarta.persistence.Entity; |
| 14 | +import jakarta.persistence.Id; |
| 15 | +import jakarta.persistence.Table; |
| 16 | + |
| 17 | +import org.hibernate.annotations.Type; |
| 18 | + |
| 19 | +import io.hypersistence.utils.hibernate.type.json.JsonBinaryType; |
| 20 | + |
| 21 | +@Entity |
| 22 | +@Table(schema=ModelProperties.DB_SCHEMA, name="vuln_analysis") |
| 23 | +public class VulnAnalysis implements Serializable, RelizaEntity { |
| 24 | + private static final long serialVersionUID = 234735; |
| 25 | + |
| 26 | + @Id |
| 27 | + private UUID uuid = UUID.randomUUID(); |
| 28 | + |
| 29 | + @Column(nullable = false) |
| 30 | + private int revision=0; |
| 31 | + |
| 32 | + @Column(nullable = false) |
| 33 | + private int schemaVersion=0; |
| 34 | + |
| 35 | + @Column(nullable = false) |
| 36 | + private ZonedDateTime createdDate = ZonedDateTime.now(); |
| 37 | + |
| 38 | + @Column(nullable = false) |
| 39 | + private ZonedDateTime lastUpdatedDate = ZonedDateTime.now(); |
| 40 | + |
| 41 | + @Type(JsonBinaryType.class) |
| 42 | + @Column(columnDefinition = ModelProperties.JSONB) |
| 43 | + private Map<String,Object> recordData; |
| 44 | + |
| 45 | + @Override |
| 46 | + public UUID getUuid() { |
| 47 | + return uuid; |
| 48 | + } |
| 49 | + |
| 50 | + public void setUuid(UUID uuid) { |
| 51 | + this.uuid = uuid; |
| 52 | + } |
| 53 | + |
| 54 | + @Override |
| 55 | + public int getRevision() { |
| 56 | + return revision; |
| 57 | + } |
| 58 | + |
| 59 | + public void setRevision(int revision) { |
| 60 | + this.revision = revision; |
| 61 | + } |
| 62 | + |
| 63 | + @Override |
| 64 | + public ZonedDateTime getCreatedDate() { |
| 65 | + return createdDate; |
| 66 | + } |
| 67 | + |
| 68 | + public void setCreatedDate(ZonedDateTime createdDate) { |
| 69 | + this.createdDate = createdDate; |
| 70 | + } |
| 71 | + |
| 72 | + @Override |
| 73 | + public ZonedDateTime getLastUpdatedDate() { |
| 74 | + return lastUpdatedDate; |
| 75 | + } |
| 76 | + |
| 77 | + public void setLastUpdatedDate(ZonedDateTime lastUpdatedDate) { |
| 78 | + this.lastUpdatedDate = lastUpdatedDate; |
| 79 | + } |
| 80 | + |
| 81 | + @Override |
| 82 | + public Map<String, Object> getRecordData() { |
| 83 | + return recordData; |
| 84 | + } |
| 85 | + |
| 86 | + @Override |
| 87 | + public void setRecordData(Map<String, Object> recordData) { |
| 88 | + this.recordData = recordData; |
| 89 | + } |
| 90 | + |
| 91 | + @Override |
| 92 | + public int getSchemaVersion() { |
| 93 | + return schemaVersion; |
| 94 | + } |
| 95 | + |
| 96 | + public void setSchemaVersion(int schemaVersion) { |
| 97 | + this.schemaVersion = schemaVersion; |
| 98 | + } |
| 99 | +} |
0 commit comments