blob: ee8c5c2ac79f75d8574205989f32ad4852051b8f [file] [log] [blame]
/*
* Copyright 2017 Kuelap, Inc.
*
* 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 io.mifos.portfolio.service.internal.repository;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;
/**
* @author Myrle Krantz
*/
@Entity
@Table(name = "bastet_p_balance_segs")
public class BalanceSegmentSetEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "product_id", nullable = false)
private ProductEntity product;
@Column(name = "seg_set_identifier", nullable = false)
private String segmentSetIdentifier;
@Column(name = "segment_identifier", nullable = false)
private String segmentIdentifier;
@Column(name = "lower_bound")
private BigDecimal lowerBound;
public BalanceSegmentSetEntity() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public ProductEntity getProduct() {
return product;
}
public void setProduct(ProductEntity product) {
this.product = product;
}
public String getSegmentSetIdentifier() {
return segmentSetIdentifier;
}
public void setSegmentSetIdentifier(String segmentSetIdentifier) {
this.segmentSetIdentifier = segmentSetIdentifier;
}
public String getSegmentIdentifier() {
return segmentIdentifier;
}
public void setSegmentIdentifier(String segmentIdentifier) {
this.segmentIdentifier = segmentIdentifier;
}
public BigDecimal getLowerBound() {
return lowerBound;
}
public void setLowerBound(BigDecimal lowerBound) {
this.lowerBound = lowerBound;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BalanceSegmentSetEntity that = (BalanceSegmentSetEntity) o;
return Objects.equals(product, that.product) &&
Objects.equals(segmentSetIdentifier, that.segmentSetIdentifier) &&
Objects.equals(segmentIdentifier, that.segmentIdentifier);
}
@Override
public int hashCode() {
return Objects.hash(product, segmentSetIdentifier, segmentIdentifier);
}
}