This commit is contained in:
Maxime Dagnicourt
2008-01-22 10:15:00 +00:00
parent b3e904bc29
commit da5155ebae

View File

@@ -3,7 +3,6 @@ package org.yacos.core.article;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
@@ -26,30 +25,30 @@ public class PreferencePK implements Serializable{
/** /**
* Public key, following these recomandations : http://www.jpox.org/docs/1_2/primary_key.html * Public key, following these recomandations : http://www.jpox.org/docs/1_2/primary_key.html
*/ */
@Id
@ManyToOne(targetEntity=User.class) @ManyToOne(targetEntity=User.class)
@JoinColumn(name="pcmember_id",nullable=false) @JoinColumn(name="pcmember_id",nullable=false)
public User pcMember; public User pcMember;
/** /**
* Public key, following these recomandations : http://www.jpox.org/docs/1_2/primary_key.html * Public key, following these recomandations : http://www.jpox.org/docs/1_2/primary_key.html
*/ */
@Id
@ManyToOne(targetEntity=Article.class) @ManyToOne(targetEntity=Article.class)
@JoinColumn(name="article_id",nullable=false) @JoinColumn(name="article_id",nullable=false)
public Article article; public Article article;
// @Override @Override
// public boolean equals(Object obj) { public boolean equals(Object obj) {
// if (! (obj instanceof PreferencePK) ) { if (! (obj instanceof PreferencePK) ) {
// return false; return false;
// } }
// PreferencePK other = (PreferencePK) obj; PreferencePK other = (PreferencePK) obj;
// return this.pcMember.getLogin().equals(other.pcMember.getLogin()) && return this.pcMember.getLogin().equals(other.pcMember.getLogin()) &&
// this.article.getId() == other.article.getId(); this.article.getId() == other.article.getId();
// } }
//
// @Override @Override
// public int hashCode() { public int hashCode() {
// return this.pcMember.getLogin().hashCode() ^ this.article.getId(); return this.pcMember.getLogin().hashCode() ^ this.article.getId();
// } }
} }