package com.acme.model.domain.sc.entity;


import com.acme.structure.BaseEntityListener;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

@Entity(name = "CustomerDeliveryAddress")
@Table(name = "CUSTDELADDRESSES")
@DiscriminatorValue("CustomerDeliveryAddress")
@PrimaryKeyJoinColumn(name = "ADDRESSID", referencedColumnName = "ID")
@EntityListeners( { BaseEntityListener.class })
public class CustomerDeliveryAddress extends DeliveryAddress
{
    private boolean passive;
    private boolean defaultAddress;

    public CustomerDeliveryAddress()
    {
        entityName = "CustomerDeliveryAddress";
        setDefaultAddress(true);
        setAddressType(this.getEntityName());
    }

    public void setPassive(boolean passive)
    {
        this.passive = passive;
    }

    public void setDefaultAddress(boolean defaultAddress)
    {
        this.defaultAddress = defaultAddress;
    }

    @Column(name = "DEFAULTADDRESS")
    public boolean isDefaultAddress()
    {
        return defaultAddress;
    }

    @Column(name = "PASSIVE")
    public boolean isPassive()
    {
        return passive;
    }
}
