package com.acme.structure.exception.persistent;

import com.acme.structure.BaseEntity;
import com.acme.structure.exception.base.ApplicationException;
import com.acme.structure.exception.base.InfrastructureException;

public class CascadeRemovedEntityException extends InfrastructureException
{
    private BaseEntity removedEntity;

    public CascadeRemovedEntityException(BaseEntity removedEntity)
    {
        exceptionCode = "04";
        exceptionType = ApplicationException.EXCEPTION_TYPE_WARNING;
        setRemovedEntity(removedEntity);
    }

    public BaseEntity getRemovedEntity()
    {
        return removedEntity;
    }

    public void setRemovedEntity(BaseEntity removedEntity)
    {
        this.removedEntity = removedEntity;
    }

    public String getReason()
    {
        return removedEntity.toString();
    }
}
