Skip to content

Commit

Permalink
Merge pull request #1467 from DependencyTrack/revert-1464-revert-1452…
Browse files Browse the repository at this point in the history
…-issue-1417-replace-uuid-columns-with-native-type

Revert "Revert "Use native `UUID` type for UUID colums""
  • Loading branch information
nscuro authored Aug 26, 2024
2 parents bb3ffa2 + 482d251 commit a993d95
Show file tree
Hide file tree
Showing 11 changed files with 2,537 additions and 1,566 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.JdbcType;
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType;

import java.util.UUID;

Expand Down Expand Up @@ -88,6 +90,7 @@ public class Component extends PanacheEntityBase {
private Project project;

@Column(name = "UUID")
@JdbcType(UUIDJdbcType.class)
private UUID uuid;

@Column(name = "MD5", columnDefinition = "VARCHAR")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import org.hibernate.annotations.JdbcType;
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType;

import java.util.UUID;

Expand Down Expand Up @@ -55,6 +57,7 @@ public class NotificationPublisher extends PanacheEntityBase {
private boolean defaultPublisher;

@Column(name = "UUID")
@JdbcType(UUIDJdbcType.class)
private UUID uuid;

public long getId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import jakarta.persistence.Table;
import org.dependencytrack.persistence.converter.NotificationLevelConverter;
import org.dependencytrack.persistence.converter.NotificationScopeConverter;
import org.hibernate.annotations.JdbcType;
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType;

import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -96,6 +98,7 @@ public class NotificationRule extends PanacheEntityBase {
private String publisherConfig;

@Column(name = "UUID")
@JdbcType(UUIDJdbcType.class)
private UUID uuid;

@Column(name = "NOTIFY_CHILDREN")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import com.github.packageurl.MalformedPackageURLException;
import com.github.packageurl.PackageURL;
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.dependencytrack.persistence.converter.ClassifierToStringConverter;

import jakarta.persistence.Column;
import jakarta.persistence.Convert;
import jakarta.persistence.Entity;
Expand All @@ -33,6 +31,9 @@
import jakarta.persistence.OneToMany;
import jakarta.persistence.OrderBy;
import jakarta.persistence.Table;
import org.dependencytrack.persistence.converter.ClassifierToStringConverter;
import org.hibernate.annotations.JdbcType;
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType;

import java.io.Serializable;
import java.util.Collection;
Expand Down Expand Up @@ -100,6 +101,7 @@ public class Project implements Serializable {
private String directDependencies;

@Column(name = "UUID")
@JdbcType(UUIDJdbcType.class)
private UUID uuid;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import org.dependencytrack.persistence.converter.RepositoryTypeConverter;
import org.hibernate.annotations.JdbcType;
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType;

import java.util.Optional;
import java.util.UUID;
Expand Down Expand Up @@ -66,6 +68,7 @@ public class Repository {
private String password;

@Column(name = "UUID")
@JdbcType(UUIDJdbcType.class)
private UUID uuid;

public long getId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import org.dependencytrack.common.model.Severity;
import org.dependencytrack.commonutil.VulnerabilityUtil;
import org.dependencytrack.persistence.converter.CollectionIntegerConverter;
import org.hibernate.annotations.JdbcType;
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType;

import java.math.BigDecimal;
import java.util.ArrayList;
Expand Down Expand Up @@ -165,6 +167,7 @@ public enum Source {
private List<Component> components;

@Column(name = "UUID")
@JdbcType(UUIDJdbcType.class)
private UUID uuid;

@OneToMany
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import org.apache.commons.lang3.tuple.Pair;
import org.hibernate.annotations.JdbcType;
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Map;
Expand Down Expand Up @@ -70,6 +73,7 @@ public class VulnerabilityAlias implements Serializable {
private String vulnDbId;

@Column(name = "UUID")
@JdbcType(UUIDJdbcType.class)
private UUID uuid;

public long getId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import jakarta.persistence.ManyToMany;
import jakarta.persistence.OrderBy;
import jakarta.persistence.Table;
import org.hibernate.annotations.JdbcType;
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -134,6 +136,7 @@ public class VulnerableSoftware extends PanacheEntityBase implements ICpe {
private List<Vulnerability> vulnerabilities;

@Column(name = "UUID")
@JdbcType(UUIDJdbcType.class)
private UUID uuid;

public long getId() {
Expand Down
Loading

0 comments on commit a993d95

Please sign in to comment.