Embeddable class Watson should be in a stand alone class file.

This commit is contained in:
Tom Vahlman 2012-03-26 10:54:08 +02:00
parent ac500e5347
commit 7bedf545e0
2 changed files with 106 additions and 104 deletions
src/main/java/se/su/dsv/scipro/match/dataobject

@ -301,110 +301,6 @@ public class ProjectIdea extends DomainObject {
return match.getStatus().toString();
}
@Embeddable
public static class Watson implements Serializable {
private static final long serialVersionUID = 6425139094214449167L;
// Watson-box-data
@Column(nullable = false, length = 1024)
private String what = "";
@Column(nullable = false, length = 1024)
private String why = "";
@Column(nullable = false, length = 1024)
private String theoryHow = "";
@Column(nullable = false, length = 1024)
private String practicalHow = "";
public String getWhat() {
return what;
}
public void setWhat(String what) {
this.what = what;
}
public String getWhy() {
return why;
}
public void setWhy(String why) {
this.why = why;
}
public String getTheoryHow() {
return theoryHow;
}
public void setTheoryHow(String theoryHow) {
this.theoryHow = theoryHow;
}
public String getPracticalHow() {
return practicalHow;
}
public void setPracticalHow(String practicalHow) {
this.practicalHow = practicalHow;
}
@Override
public String toString() {
return "Watson [what=" + what + ", why=" + why + ", theoryHow="
+ theoryHow + ", practicalHow=" + practicalHow + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result =
prime * result
+ ((practicalHow == null) ? 0 : practicalHow.hashCode());
result =
prime * result
+ ((theoryHow == null) ? 0 : theoryHow.hashCode());
result = prime * result + ((what == null) ? 0 : what.hashCode());
result = prime * result + ((why == null) ? 0 : why.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Watson other = (Watson) obj;
if (practicalHow == null) {
if (other.practicalHow != null)
return false;
} else if (!practicalHow.equals(other.practicalHow))
return false;
if (theoryHow == null) {
if (other.theoryHow != null)
return false;
} else if (!theoryHow.equals(other.theoryHow))
return false;
if (what == null) {
if (other.what != null)
return false;
} else if (!what.equals(other.what))
return false;
if (why == null) {
if (other.why != null)
return false;
} else if (!why.equals(other.why))
return false;
return true;
}
}
public void addMatch(Match match) {
match.setProjectIdea(this);
this.match = match;

@ -0,0 +1,106 @@
package se.su.dsv.scipro.match.dataobject;
import javax.persistence.*;
import java.io.Serializable;
@Embeddable
public class Watson implements Serializable {
private static final long serialVersionUID = 8028674038959771277L;
// Watson-box-data
@Column(nullable = false, length = 1024)
private String what = "";
@Column(nullable = false, length = 1024)
private String why = "";
@Column(nullable = false, length = 1024)
private String theoryHow = "";
@Column(nullable = false, length = 1024)
private String practicalHow = "";
public String getWhat() {
return what;
}
public void setWhat(String what) {
this.what = what;
}
public String getWhy() {
return why;
}
public void setWhy(String why) {
this.why = why;
}
public String getTheoryHow() {
return theoryHow;
}
public void setTheoryHow(String theoryHow) {
this.theoryHow = theoryHow;
}
public String getPracticalHow() {
return practicalHow;
}
public void setPracticalHow(String practicalHow) {
this.practicalHow = practicalHow;
}
@Override
public String toString() {
return "Watson [what=" + what + ", why=" + why + ", theoryHow="
+ theoryHow + ", practicalHow=" + practicalHow + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result =
prime * result
+ ((practicalHow == null) ? 0 : practicalHow.hashCode());
result =
prime * result
+ ((theoryHow == null) ? 0 : theoryHow.hashCode());
result = prime * result + ((what == null) ? 0 : what.hashCode());
result = prime * result + ((why == null) ? 0 : why.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Watson other = (Watson) obj;
if (practicalHow == null) {
if (other.practicalHow != null)
return false;
} else if (!practicalHow.equals(other.practicalHow))
return false;
if (theoryHow == null) {
if (other.theoryHow != null)
return false;
} else if (!theoryHow.equals(other.theoryHow))
return false;
if (what == null) {
if (other.what != null)
return false;
} else if (!what.equals(other.what))
return false;
if (why == null) {
if (other.why != null)
return false;
} else if (!why.equals(other.why))
return false;
return true;
}
}