src/main/java/ru/indvdum/mywork/openjpa/model/WorkId.java
author indvdum
Tue, 16 Aug 2011 15:54:50 +0300
changeset 7 aaae4f8055f4
child 8 56338d6d58c2
permissions -rw-r--r--
More JPA objects
     1 package ru.indvdum.mywork.openjpa.model;
     2 
     3 public class WorkId{
     4 	
     5 	public Integer day;
     6 	public Integer task;
     7 	
     8 	@Override
     9 	public boolean equals(Object obj) {
    10 		if (this == obj)
    11 			return true;
    12 		if (obj == null)
    13 			return false;
    14 		if (!(obj instanceof WorkId))
    15 			return false;
    16 		final WorkId other = (WorkId) obj;
    17 		return (
    18 				this.day == other.day 
    19 				&& this.task == other.task 
    20 				|| (
    21 						this.day != null 
    22 						&& this.day.equals(other.day) 
    23 						&& this.task != null 
    24 						&& this.task.equals(other.task)
    25 						)
    26 				);
    27 	}
    28 
    29 	@Override
    30 	public int hashCode() {
    31 		return day ^ task;
    32 	}
    33 
    34 }