package devopsdistilled.operp.server.data.entity.business;

import java.util.LinkedList;
import java.util.List;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import devopsdistilled.operp.server.data.entity.Entiti;

@MappedSuperclass
public abstract class BusinessDesc<B extends Business<?, ?>, DR extends BusinessDescRow<?>>
		extends Entiti<Long> {

	private static final long serialVersionUID = 7790361115068372068L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	protected Long businessId;

	@OneToOne(mappedBy = "businessDesc")
	protected B business;

	@OneToMany(mappedBy = "businessDesc")
	protected List<DR> descRows = new LinkedList<>();

	private Double discountAmount;

	private Double TotalAmount;

	public Long getBusinessId() {
		return businessId;
	}

	public void setBusinessId(Long businessId) {
		this.businessId = businessId;
	}

	public Double getDiscountAmount() {
		return discountAmount;
	}

	public void setDiscountAmount(Double discountAmount) {
		this.discountAmount = discountAmount;
	}

	public Double getTotalAmount() {
		return TotalAmount;
	}

	public void setTotalAmount(Double totalAmount) {
		TotalAmount = totalAmount;
	}

	public B getBusiness() {
		return business;
	}

	public void setBusiness(B business) {
		this.business = business;
	}

	public List<DR> getDescRows() {
		return descRows;
	}

	public void setDescRows(List<DR> descRows) {
		this.descRows = descRows;
	}

	@Override
	public Long id() {
		return getBusinessId();
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

}

@@ -299,43 +299,8 @@
 any;
-%0Aimport javax.persistence.OneToOne;
 %0A%0Aim
@@ -646,70 +646,8 @@
 d;%0A%0A
-%09@OneToOne(mappedBy = %22businessDesc%22)%0A%09protected B business;%0A%0A
 %09@On
@@ -1247,128 +1247,8 @@
 %09%7D%0A%0A
-%09public B getBusiness() %7B%0A%09%09return business;%0A%09%7D%0A%0A%09public void setBusiness(B business) %7B%0A%09%09this.business = business;%0A%09%7D%0A%0A
 %09pub

Remove reference to Business