Commit 23b32c47 by jkj

votesId -> id

git-svn-id: https://dev.intra.insomnia.fi/svn/trunk@45 8cf89bec-f6a3-4178-919f-364fb3449fe5
1 parent 61d298e3
...@@ -8,7 +8,6 @@ package fi.insomnia.bortal.model; ...@@ -8,7 +8,6 @@ package fi.insomnia.bortal.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
...@@ -29,18 +28,16 @@ import javax.persistence.UniqueConstraint; ...@@ -29,18 +28,16 @@ import javax.persistence.UniqueConstraint;
"entries_id", "users_id" }) }) "entries_id", "users_id" }) })
@NamedQueries( { @NamedQueries( {
@NamedQuery(name = "Vote.findAll", query = "SELECT v FROM Vote v"), @NamedQuery(name = "Vote.findAll", query = "SELECT v FROM Vote v"),
@NamedQuery(name = "Vote.findByVotesId", query = "SELECT v FROM Vote v WHERE v.votesId = :votesId"), @NamedQuery(name = "Vote.findById", query = "SELECT v FROM Vote v WHERE v.id = :id"),
@NamedQuery(name = "Vote.findByScore", query = "SELECT v FROM Vote v WHERE v.score = :score"), @NamedQuery(name = "Vote.findByScore", query = "SELECT v FROM Vote v WHERE v.score = :score"),
@NamedQuery(name = "Vote.findByVoteTime", query = "SELECT v FROM Vote v WHERE v.voteTime = :voteTime") }) @NamedQuery(name = "Vote.findByVoteTime", query = "SELECT v FROM Vote v WHERE v.voteTime = :voteTime") })
public class Vote implements Serializable { public class Vote implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false)
@Column(name = "votes_id", nullable = false) @Column(name = "votes_id", nullable = false)
private Integer votesId; private Integer id;
@Column(name = "score") @Column(name = "score")
private Integer score; private Integer score;
@Basic(optional = false)
@Column(name = "vote_time", nullable = false) @Column(name = "vote_time", nullable = false)
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date voteTime; private Date voteTime;
...@@ -55,20 +52,20 @@ public class Vote implements Serializable { ...@@ -55,20 +52,20 @@ public class Vote implements Serializable {
} }
public Vote(Integer votesId) { public Vote(Integer votesId) {
this.votesId = votesId; this.id = votesId;
} }
public Vote(Integer votesId, Date voteTime) { public Vote(Integer votesId, Date voteTime) {
this.votesId = votesId; this.id = votesId;
this.voteTime = voteTime; this.voteTime = voteTime;
} }
public Integer getVotesId() { public Integer getVotesId() {
return votesId; return id;
} }
public void setVotesId(Integer votesId) { public void setVotesId(Integer votesId) {
this.votesId = votesId; this.id = votesId;
} }
public Integer getScore() { public Integer getScore() {
...@@ -106,7 +103,7 @@ public class Vote implements Serializable { ...@@ -106,7 +103,7 @@ public class Vote implements Serializable {
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 0; int hash = 0;
hash += (votesId != null ? votesId.hashCode() : 0); hash += (id != null ? id.hashCode() : 0);
return hash; return hash;
} }
...@@ -118,8 +115,8 @@ public class Vote implements Serializable { ...@@ -118,8 +115,8 @@ public class Vote implements Serializable {
return false; return false;
} }
Vote other = (Vote) object; Vote other = (Vote) object;
if ((this.votesId == null && other.votesId != null) if ((this.id == null && other.id != null)
|| (this.votesId != null && !this.votesId.equals(other.votesId))) { || (this.id != null && !this.id.equals(other.id))) {
return false; return false;
} }
return true; return true;
...@@ -127,7 +124,7 @@ public class Vote implements Serializable { ...@@ -127,7 +124,7 @@ public class Vote implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "fi.insomnia.bortal.model.Vote[votesId=" + votesId + "]"; return "fi.insomnia.bortal.model.Vote[id=" + id + "]";
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!