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


import com.acme.model.domain.ad.entity.Address;
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 = "DeliveryAddress")
@Table(name = "DELIVERYADDRESSES")
@DiscriminatorValue("DeliveryAddress")
@PrimaryKeyJoinColumn(name = "ADDRESSID", referencedColumnName = "ID")
@EntityListeners( { BaseEntityListener.class })
public class DeliveryAddress extends Address
{
    private String direction;
    
    public DeliveryAddress()
    {
        entityName = "DeliveryAddress";
        setAddressType(this.getEntityName());
    }

    public void setDirection(String direction)
    {
        this.direction = direction;
    }

    @Column(name = "DEFAULTADDRESS")
    public String getDirection()
    {
        return direction;
    }
}
