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


import com.acme.model.domain.ad.entity.Content;
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 = "ServiceContent")
@Table(name = "SERVICECONTENTS")
@DiscriminatorValue("ServiceContent")
@PrimaryKeyJoinColumn(name = "CONTENTID", referencedColumnName = "ID")
@EntityListeners( { BaseEntityListener.class })
public class ServiceContent extends Content
{
    private boolean defaultContent;

    public ServiceContent()
    {
        this.entityName = "ServiceContent";
        setContentType(getEntityName());
    }

    public void setDefaultContent(boolean defaultContent)
    {
        this.defaultContent = defaultContent;
    }

    @Column(name = "DEFAULTCONTENT")
    public boolean isDefaultContent()
    {
        return defaultContent;
    }

    @Override
    public String toString()
    {
        return "" + getId();
    }
}
