001 /* 002 * Sonar, open source software quality management tool. 003 * Copyright (C) 2008-2011 SonarSource 004 * mailto:contact AT sonarsource DOT com 005 * 006 * Sonar is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 3 of the License, or (at your option) any later version. 010 * 011 * Sonar is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with Sonar; if not, write to the Free Software 018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 019 */ 020 package org.sonar.jpa.entity; 021 022 import org.apache.commons.lang.builder.ToStringBuilder; 023 import org.apache.commons.lang.builder.ToStringStyle; 024 025 import javax.persistence.*; 026 import java.util.Date; 027 028 @Entity 029 @Table(name = "reviews") 030 public final class Review { 031 032 @Id 033 @Column(name = "id") 034 @GeneratedValue 035 private Long id; 036 037 @Column(name = "user_id") 038 private Integer userId; 039 040 @Column(name = "assignee_id") 041 private Integer assigneeId; 042 043 @Column(name = "title") 044 private String title; 045 046 @Column(name = "status") 047 private String status; 048 049 @Column(name = "resolution") 050 private String resolution; 051 052 @Column(name = "rule_failure_permanent_id") 053 private Integer permanentId; 054 055 @Column(name = "project_id") 056 private Integer projectId; 057 058 @Column(name = "resource_id") 059 private Integer resourceId; 060 061 @Column(name = "resource_line") 062 private Integer resourceLine; 063 064 @Column(name = "created_at") 065 private Date createdAt; 066 067 @Column(name = "updated_at") 068 private Date updatedAt; 069 070 @Column(name = "severity") 071 private String severity; 072 073 @Column(name = "rule_id") 074 private Integer ruleId; 075 076 @Column(name = "manual_violation") 077 private Boolean manualViolation; 078 079 /** 080 * @return id of review 081 */ 082 public Long getId() { 083 return id; 084 } 085 086 public void setId(Long id) { 087 this.id = id; 088 } 089 090 /** 091 * @return id of user, who created this review 092 */ 093 public Integer getUserId() { 094 return userId; 095 } 096 097 public Review setUserId(Integer userId) { 098 this.userId = userId; 099 return this; 100 } 101 102 /** 103 * @return id of assigned user or null, if not assigned 104 */ 105 public Integer getAssigneeId() { 106 return assigneeId; 107 } 108 109 public Review setAssigneeId(Integer assigneeId) { 110 this.assigneeId = assigneeId; 111 return this; 112 } 113 114 public String getTitle() { 115 return title; 116 } 117 118 public Review setTitle(String title) { 119 this.title = title; 120 return this; 121 } 122 123 public String getStatus() { 124 return status; 125 } 126 127 public void setStatus(String status) { 128 this.status = status; 129 } 130 131 public String getResolution() { 132 return resolution; 133 } 134 135 public void setResolution(String resolution) { 136 this.resolution = resolution; 137 } 138 139 public Integer getRuleFailurePermamentId() { 140 return permanentId; 141 } 142 143 public void setRuleFailurePermamentId(Integer permanentId) { 144 this.permanentId = permanentId; 145 } 146 147 public Integer getResourceLine() { 148 return resourceLine; 149 } 150 151 public void setResourceLine(Integer resourceLine) { 152 this.resourceLine = resourceLine; 153 } 154 155 public Date getUpdatedAt() { 156 return updatedAt; 157 } 158 159 public void setUpdatedAt(Date updatedAt) { 160 this.updatedAt = updatedAt; 161 } 162 163 @Override 164 public String toString() { 165 return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); 166 } 167 168 }