1.1 --- a/src/main/java/ru/indvdum/mywork/openjpa/model/Work.java Wed Aug 17 17:03:37 2011 +0300
1.2 +++ b/src/main/java/ru/indvdum/mywork/openjpa/model/Work.java Fri Aug 19 16:23:26 2011 +0300
1.3 @@ -4,6 +4,7 @@
1.4 import javax.persistence.EmbeddedId;
1.5 import javax.persistence.Entity;
1.6 import javax.persistence.FetchType;
1.7 +import javax.persistence.GeneratedValue;
1.8 import javax.persistence.ManyToOne;
1.9 import javax.persistence.MapsId;
1.10 import javax.persistence.Table;
1.11 @@ -20,7 +21,7 @@
1.12 private static final long serialVersionUID = 7138260708537798813L;
1.13
1.14 @EmbeddedId
1.15 - WorkId id;
1.16 + private WorkId id = null;
1.17
1.18 @Column(name = "HOURS")
1.19 private Float hours = null;
1.20 @@ -40,27 +41,6 @@
1.21
1.22 }
1.23
1.24 - @Override
1.25 - public boolean equals(Object obj) {
1.26 - if (this == obj)
1.27 - return true;
1.28 - if (obj == null)
1.29 - return false;
1.30 - if (!(obj instanceof Work))
1.31 - return false;
1.32 - final Work other = (Work) obj;
1.33 - return (
1.34 - this.day == other.day
1.35 - && this.task == other.task
1.36 - || (
1.37 - this.day != null
1.38 - && this.day.equals(other.day)
1.39 - && this.task != null
1.40 - && this.task.equals(other.task)
1.41 - )
1.42 - );
1.43 - }
1.44 -
1.45 public Float getHours() {
1.46 return hours;
1.47 }
1.48 @@ -93,12 +73,12 @@
1.49 this.task = task;
1.50 }
1.51
1.52 - public String getDayName() {
1.53 - return getDay().getDay().toString();
1.54 + public WorkId getId() {
1.55 + return id;
1.56 }
1.57 -
1.58 - public String getTaskName() {
1.59 - return getTask().getName();
1.60 +
1.61 + public void setId(WorkId id) {
1.62 + this.id = id;
1.63 }
1.64
1.65 }