diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-07-25 23:53:25 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-07-26 00:00:59 +0400 |
commit | 6acbf886c2cc4b8f6998481e24236b1739ba079a (patch) | |
tree | f4cb4b93d8a5897a5a96ebbadce2b0b2b1c73dc6 /sonar-core | |
parent | 3380cba1de57f48e535de91e0c98c16030a36fa8 (diff) | |
download | sonarqube-6acbf886c2cc4b8f6998481e24236b1739ba079a.tar.gz sonarqube-6acbf886c2cc4b8f6998481e24236b1739ba079a.zip |
Fix CloseReviewsDecorator for Derby and move Review entity from sonar-plugin-api to sonar-core
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/jpa/entity/Review.java | 143 | ||||
-rw-r--r-- | sonar-core/src/main/resources/META-INF/persistence.xml | 2 |
2 files changed, 144 insertions, 1 deletions
diff --git a/sonar-core/src/main/java/org/sonar/jpa/entity/Review.java b/sonar-core/src/main/java/org/sonar/jpa/entity/Review.java new file mode 100644 index 00000000000..81f9f5e595f --- /dev/null +++ b/sonar-core/src/main/java/org/sonar/jpa/entity/Review.java @@ -0,0 +1,143 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.jpa.entity; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; + +@Entity +@Table(name = "reviews") +public final class Review { + + @Id + @Column(name = "id") + @GeneratedValue + private Long id; + + @Column(name = "user_id") + private Integer userId; + + @Column(name = "assignee_id") + private Integer assigneeId; + + @Column(name = "title") + private String title; + + @Column(name = "status") + private String status; + + @Column(name = "resolution") + private String resolution; + + @Column(name = "rule_failure_permanent_id") + private Integer permanentId; + + @Column(name = "project_id") + private Integer projectId; + + @Column(name = "resource_id") + private Integer resourceId; + + @Column(name = "resource_line") + private Integer resourceLine; + + @Column(name = "created_at") + private Date createdAt; + + @Column(name = "updated_at") + private Date updatedAt; + + @Column(name = "severity") + private String severity; + + /** + * @return id of review + */ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * @return id of user, who created this review + */ + public Integer getUserId() { + return userId; + } + + public Review setUserId(Integer userId) { + this.userId = userId; + return this; + } + + /** + * @return id of assigned user or null, if not assigned + */ + public Integer getAssigneeId() { + return assigneeId; + } + + public Review setAssigneeId(Integer assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + public String getTitle() { + return title; + } + + public Review setTitle(String title) { + this.title = title; + return this; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getResolution() { + return resolution; + } + + public void setResolution(String resolution) { + this.resolution = resolution; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } + +} diff --git a/sonar-core/src/main/resources/META-INF/persistence.xml b/sonar-core/src/main/resources/META-INF/persistence.xml index f3b022a96a3..4250a8c33a3 100644 --- a/sonar-core/src/main/resources/META-INF/persistence.xml +++ b/sonar-core/src/main/resources/META-INF/persistence.xml @@ -34,7 +34,7 @@ <class>org.sonar.api.profiles.Alert</class> <class>org.sonar.api.rules.ActiveRuleChange</class> <class>org.sonar.api.rules.ActiveRuleParamChange</class> - <class>org.sonar.api.database.model.Review</class> + <class>org.sonar.jpa.entity.Review</class> <class>org.sonar.jpa.entity.NotificationQueueElement</class> <properties> |