aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-09-01 19:06:46 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-09-02 00:16:21 +0400
commit5ff8c8c74e58a9df51be059908a064a43a67c50d (patch)
tree557856493faeb208510a056b1d665f838f907402 /sonar-core
parentd76c641b9f6ad77d26f1bc80f850ed3b2496a91d (diff)
downloadsonarqube-5ff8c8c74e58a9df51be059908a064a43a67c50d.tar.gz
sonarqube-5ff8c8c74e58a9df51be059908a064a43a67c50d.zip
SONAR-1091 CPD over different projects
* Improve table clone_blocks and so DbCloneIndex. * Add purge of old clone blocks.
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/entity/CloneBlock.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/sonar-core/src/main/java/org/sonar/jpa/entity/CloneBlock.java b/sonar-core/src/main/java/org/sonar/jpa/entity/CloneBlock.java
index b4de0db290a..7589a9947dd 100644
--- a/sonar-core/src/main/java/org/sonar/jpa/entity/CloneBlock.java
+++ b/sonar-core/src/main/java/org/sonar/jpa/entity/CloneBlock.java
@@ -25,8 +25,6 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
-import org.sonar.api.database.model.ResourceModel;
-
/**
* @since 2.11
*/
@@ -44,12 +42,12 @@ public class CloneBlock {
@Column(name = "snapshot_id", updatable = false, nullable = false)
private Integer snapshotId;
+ @Column(name = "project_snapshot_id", updatable = false, nullable = false)
+ private Integer projectSnapshotId;
+
@Column(name = "hash", updatable = false, nullable = false, length = BLOCK_HASH_SIZE)
private String hash;
- @Column(name = "resource_key", updatable = false, nullable = false, length = ResourceModel.KEY_SIZE)
- private String resourceKey;
-
@Column(name = "index_in_file", updatable = false, nullable = false)
private Integer indexInFile;
@@ -62,11 +60,11 @@ public class CloneBlock {
public CloneBlock() {
}
- public CloneBlock(Integer snapshotId, String hash, String resourceKey, Integer indexInFile, Integer startLine, Integer endLine) {
+ public CloneBlock(Integer projectSnapshotId, Integer snapshotId, String hash, Integer indexInFile, Integer startLine, Integer endLine) {
+ this.projectSnapshotId = projectSnapshotId;
this.snapshotId = snapshotId;
this.hash = hash;
this.indexInFile = indexInFile;
- this.resourceKey = resourceKey;
this.startLine = startLine;
this.endLine = endLine;
}
@@ -79,8 +77,8 @@ public class CloneBlock {
return snapshotId;
}
- public String getResourceKey() {
- return resourceKey;
+ public Integer getProjectSnapshotId() {
+ return projectSnapshotId;
}
public String getHash() {