com.blazebit.persistence.testsuite.entity.OrderPositionHeadId Maven / Gradle / Ivy
/*
* Copyright 2014 - 2019 Blazebit.
*
* 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 com.blazebit.persistence.testsuite.entity;
import java.io.Serializable;
import javax.persistence.Embeddable;
/**
*
* @author Christian Beikov
* @author Moritz Becker
* @since 1.0.0
*/
@Embeddable
public class OrderPositionHeadId implements Serializable {
private static final long serialVersionUID = 1L;
private Long orderId;
private Integer position;
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
@Override
public int hashCode() {
int hash = 5;
hash = 97 * hash + (this.orderId != null ? this.orderId.hashCode() : 0);
hash = 97 * hash + (this.position != null ? this.position.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final OrderPositionHeadId other = (OrderPositionHeadId) obj;
if (this.orderId != other.orderId && (this.orderId == null || !this.orderId.equals(other.orderId))) {
return false;
}
if (this.position != other.position && (this.position == null || !this.position.equals(other.position))) {
return false;
}
return true;
}
}