src/main/java/ru/indvdum/mywork/openjpa/model/WorkId.java
changeset 7 aaae4f8055f4
child 8 56338d6d58c2
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/main/java/ru/indvdum/mywork/openjpa/model/WorkId.java	Tue Aug 16 15:54:50 2011 +0300
     1.3 @@ -0,0 +1,34 @@
     1.4 +package ru.indvdum.mywork.openjpa.model;
     1.5 +
     1.6 +public class WorkId{
     1.7 +	
     1.8 +	public Integer day;
     1.9 +	public Integer task;
    1.10 +	
    1.11 +	@Override
    1.12 +	public boolean equals(Object obj) {
    1.13 +		if (this == obj)
    1.14 +			return true;
    1.15 +		if (obj == null)
    1.16 +			return false;
    1.17 +		if (!(obj instanceof WorkId))
    1.18 +			return false;
    1.19 +		final WorkId other = (WorkId) obj;
    1.20 +		return (
    1.21 +				this.day == other.day 
    1.22 +				&& this.task == other.task 
    1.23 +				|| (
    1.24 +						this.day != null 
    1.25 +						&& this.day.equals(other.day) 
    1.26 +						&& this.task != null 
    1.27 +						&& this.task.equals(other.task)
    1.28 +						)
    1.29 +				);
    1.30 +	}
    1.31 +
    1.32 +	@Override
    1.33 +	public int hashCode() {
    1.34 +		return day ^ task;
    1.35 +	}
    1.36 +
    1.37 +}