Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

DuplicationBlock.java 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Sonar, open source software quality management tool.
  3. * Copyright (C) 2008-2011 SonarSource
  4. * mailto:contact AT sonarsource DOT com
  5. *
  6. * Sonar is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * Sonar is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with Sonar; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
  19. */
  20. package org.sonar.jpa.entity;
  21. import javax.persistence.Column;
  22. import javax.persistence.Entity;
  23. import javax.persistence.GeneratedValue;
  24. import javax.persistence.Id;
  25. import javax.persistence.Table;
  26. /**
  27. * @since 2.11
  28. */
  29. @Entity
  30. @Table(name = "duplications_index")
  31. public class DuplicationBlock {
  32. public static final int BLOCK_HASH_SIZE = 50;
  33. @Id
  34. @Column(name = "id")
  35. @GeneratedValue
  36. private Integer id;
  37. @Column(name = "snapshot_id", updatable = false, nullable = false)
  38. private Integer snapshotId;
  39. @Column(name = "project_snapshot_id", updatable = false, nullable = false)
  40. private Integer projectSnapshotId;
  41. @Column(name = "hash", updatable = false, nullable = false, length = BLOCK_HASH_SIZE)
  42. private String hash;
  43. @Column(name = "index_in_file", updatable = false, nullable = false)
  44. private Integer indexInFile;
  45. @Column(name = "start_line", updatable = false, nullable = false)
  46. private Integer startLine;
  47. @Column(name = "end_line", updatable = false, nullable = false)
  48. private Integer endLine;
  49. public DuplicationBlock() {
  50. }
  51. public DuplicationBlock(Integer projectSnapshotId, Integer snapshotId, String hash, Integer indexInFile, Integer startLine, Integer endLine) {
  52. this.projectSnapshotId = projectSnapshotId;
  53. this.snapshotId = snapshotId;
  54. this.hash = hash;
  55. this.indexInFile = indexInFile;
  56. this.startLine = startLine;
  57. this.endLine = endLine;
  58. }
  59. public Integer getId() {
  60. return id;
  61. }
  62. public Integer getSnapshotId() {
  63. return snapshotId;
  64. }
  65. public Integer getProjectSnapshotId() {
  66. return projectSnapshotId;
  67. }
  68. public String getHash() {
  69. return hash;
  70. }
  71. public Integer getIndexInFile() {
  72. return indexInFile;
  73. }
  74. public Integer getStartLine() {
  75. return startLine;
  76. }
  77. public Integer getEndLine() {
  78. return endLine;
  79. }
  80. }