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 java.util.Date; 023 024 import javax.persistence.Column; 025 import javax.persistence.Entity; 026 import javax.persistence.GeneratedValue; 027 import javax.persistence.Id; 028 import javax.persistence.Table; 029 030 import org.apache.commons.lang.builder.ToStringBuilder; 031 import org.apache.commons.lang.builder.ToStringStyle; 032 033 @Entity 034 @Table(name = "reviews") 035 public final class Review { 036 037 @Id 038 @Column(name = "id") 039 @GeneratedValue 040 private Long id; 041 042 @Column(name = "user_id") 043 private Integer userId; 044 045 @Column(name = "assignee_id") 046 private Integer assigneeId; 047 048 @Column(name = "title") 049 private String title; 050 051 @Column(name = "status") 052 private String status; 053 054 @Column(name = "resolution") 055 private String resolution; 056 057 @Column(name = "rule_failure_permanent_id") 058 private Integer permanentId; 059 060 @Column(name = "project_id") 061 private Integer projectId; 062 063 @Column(name = "resource_id") 064 private Integer resourceId; 065 066 @Column(name = "resource_line") 067 private Integer resourceLine; 068 069 @Column(name = "created_at") 070 private Date createdAt; 071 072 @Column(name = "updated_at") 073 private Date updatedAt; 074 075 @Column(name = "severity") 076 private String severity; 077 078 /** 079 * @return id of review 080 */ 081 public Long getId() { 082 return id; 083 } 084 085 public void setId(Long id) { 086 this.id = id; 087 } 088 089 /** 090 * @return id of user, who created this review 091 */ 092 public Integer getUserId() { 093 return userId; 094 } 095 096 public Review setUserId(Integer userId) { 097 this.userId = userId; 098 return this; 099 } 100 101 /** 102 * @return id of assigned user or null, if not assigned 103 */ 104 public Integer getAssigneeId() { 105 return assigneeId; 106 } 107 108 public Review setAssigneeId(Integer assigneeId) { 109 this.assigneeId = assigneeId; 110 return this; 111 } 112 113 public String getTitle() { 114 return title; 115 } 116 117 public Review setTitle(String title) { 118 this.title = title; 119 return this; 120 } 121 122 public String getStatus() { 123 return status; 124 } 125 126 public void setStatus(String status) { 127 this.status = status; 128 } 129 130 public String getResolution() { 131 return resolution; 132 } 133 134 public void setResolution(String resolution) { 135 this.resolution = resolution; 136 } 137 138 @Override 139 public String toString() { 140 return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); 141 } 142 143 }