diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-03-09 17:22:55 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-03-12 16:06:20 +0100 |
commit | 4ad73a8ade0de8d42b34480d387e77156017929c (patch) | |
tree | e0467a793330c880e8b0abbdf9b73a12ed7c2eae /sonar-plugin-api/src | |
parent | 5dd1589424e001336559168dd702ba73b7fd44ba (diff) | |
download | sonarqube-4ad73a8ade0de8d42b34480d387e77156017929c.tar.gz sonarqube-4ad73a8ade0de8d42b34480d387e77156017929c.zip |
SONAR-6262 Add project_links.component_uuid column
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java | 10 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectLink.java | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java index 25b564605e0..3f0f2469cbb 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java @@ -30,14 +30,7 @@ import org.sonar.api.resources.ProjectLink; import org.sonar.api.resources.Resource; import javax.annotation.Nullable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; +import javax.persistence.*; import java.util.ArrayList; import java.util.Date; @@ -102,6 +95,7 @@ public class ResourceModel extends BaseIdentifiable implements Cloneable { private Date createdAt; @OneToMany(mappedBy = "resource", fetch = FetchType.LAZY, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE}) + @JoinColumn(name = "component_uuid") @BatchSize(size = 8) private List<ProjectLink> projectLinks = new ArrayList<ProjectLink>(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectLink.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectLink.java index 079d5160417..3e4f276571d 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectLink.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectLink.java @@ -38,7 +38,7 @@ public class ProjectLink extends BaseIdentifiable { public static final int HREF_COLUMN_SIZE = 2048; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "project_id", updatable = false, nullable = false) + @JoinColumn(name = "component_uuid", referencedColumnName = "uuid", updatable = false, nullable = false) private ResourceModel resource; @Column(name = "link_type", updatable = true, nullable = true, length = 20) |