Commit b2a982ed by jkj

comments

git-svn-id: https://dev.intra.insomnia.fi/svn/trunk@37 8cf89bec-f6a3-4178-919f-364fb3449fe5
1 parent 8470dd6d
...@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model; ...@@ -7,6 +7,7 @@ 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.Basic;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
...@@ -21,17 +22,16 @@ import javax.persistence.TemporalType; ...@@ -21,17 +22,16 @@ import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
/** /**
* * A vote for a compo entry
* @author jkj
*/ */
@Entity @Entity
@Table(name = "votes", uniqueConstraints = { @Table(name = "votes", uniqueConstraints = { @UniqueConstraint(columnNames = {
@UniqueConstraint(columnNames = {"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.findByVotesId", query = "SELECT v FROM Vote v WHERE v.votesId = :votesId"),
@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
...@@ -112,12 +112,14 @@ public class Vote implements Serializable { ...@@ -112,12 +112,14 @@ public class Vote implements Serializable {
@Override @Override
public boolean equals(Object object) { public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set // TODO: Warning - this method won't work in the case the id fields are
// not set
if (!(object instanceof Vote)) { if (!(object instanceof Vote)) {
return false; return false;
} }
Vote other = (Vote) object; Vote other = (Vote) object;
if ((this.votesId == null && other.votesId != null) || (this.votesId != null && !this.votesId.equals(other.votesId))) { if ((this.votesId == null && other.votesId != null)
|| (this.votesId != null && !this.votesId.equals(other.votesId))) {
return false; return false;
} }
return true; return true;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!