CostGroupTolerance.java

package com.tradecloud.domain.costing;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;

/**
 * Entity that holds an upper and lower tolerance for a specific cost group.
 */
@Entity
@Table(name = "costgrouptolerance")
@Access(AccessType.FIELD)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "CostGroupTolerance")
public class CostGroupTolerance extends ToleranceRange implements Serializable {

    private static final long serialVersionUID = 1L;

    @XmlAttribute
    @Enumerated(EnumType.STRING)
    @NotNull
    private CostGroup costGroup;

    public CostGroup getCostGroup() {
        return costGroup;
    }

    public void setCostGroup(CostGroup costGroup) {
        this.costGroup = costGroup;
    }
}