/*
* Copyright (C) 2011 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.errai.bus.client.tests.support;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
//import pl.scentia.smartoffice.persistence.pojo.AbstractDocument;
//import pl.scentia.smartoffice.persistence.pojo.OrganizationUnit;
@MappedSuperclass
public abstract class AbstractAssignment extends AbstractDocument implements Serializable {
private static final long serialVersionUID = 2658581482246530051L;
/*@ManyToOne(cascade={CascadeType.PERSIST,CascadeType.REMOVE,CascadeType.REFRESH})
@JoinColumn(name="SOURCE_ID")
private OrganizationUnit sourceUnit;*/
/*@ManyToOne(cascade={CascadeType.PERSIST,CascadeType.REMOVE,CascadeType.REFRESH})
@JoinColumn(name="DEST_ID")
private OrganizationUnit destinationUnit;
public OrganizationUnit getSourceUnit() {
return sourceUnit;
}
public void setSourceUnit(OrganizationUnit sourceUnit) {
this.sourceUnit = sourceUnit;
}
public OrganizationUnit getDestinationUnit() {
return destinationUnit;
}
public void setDestinationUnit(OrganizationUnit destinationUnit) {
this.destinationUnit = destinationUnit;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((destinationUnit == null) ? 0 : destinationUnit.hashCode());
result = prime * result
+ ((sourceUnit == null) ? 0 : sourceUnit.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
if (this == obj)
return true;
if (getClass() != obj.getClass())
return false;
AbstractAssignment other = (AbstractAssignment) obj;
if (destinationUnit == null) {
if (other.destinationUnit != null)
return false;
} else if (!destinationUnit.equals(other.destinationUnit))
return false;
if (sourceUnit == null) {
if (other.sourceUnit != null)
return false;
} else if (!sourceUnit.equals(other.sourceUnit))
return false;
return true;
} */
@Override
public boolean equals(Object o) {
return super.equals(o);
}
}