Publisher.java 1.96 KB
package org.legrog.entities;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Set;

@Entity
//@Table(name = "editeur")
public class Publisher /* extends org.roliste.data.DbLinkableEntity */ {
// TODO L'éventuel usage de Linkable reste à confirmer https://tree.taiga.io/project/jr-utily-grog-v3/us/48
// TODO Attention, en v2 Linkable implique Traceable (journalisable) qui devrait aussi être évalué
    @Id
    @Column(name = "PUBLISHER_ID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int publisherId;

    @OneToOne
    private PublisherRevision activeRevision;

    @OneToOne
    private User activeValidator;

    private Timestamp validationDateTime;

    @OneToMany(mappedBy = "publisher")
    private Set<PublisherRevision> revisions;

    public int getPublisherId() {
        return publisherId;
    }

    public void setPublisherId(int publisherId) {
        this.publisherId = publisherId;
    }

    public PublisherRevision getActiveRevision() {
        return activeRevision;
    }

    public void setActiveRevision(PublisherRevision activeRevision) {
        this.activeRevision = activeRevision;
    }

    public Set<PublisherRevision> getRevisions() {
        return revisions;
    }

    public void setRevisions(Set<PublisherRevision> revisions) {
        this.revisions = revisions;
    }

    public User getActiveValidator() {
        return activeValidator;
    }

    public void setActiveValidator(User activeValidator) {
        this.activeValidator = activeValidator;
    }

    public Timestamp getValidationDateTime() {
        return validationDateTime;
    }

    public void setValidationDateTime(Timestamp validationDateTime) {
        this.validationDateTime = validationDateTime;
    }

    @Override
    public String toString() {
        return "PUBLISHER_ID = " + publisherId + ", Active Revision = " + activeRevision + ", Validator = " + activeValidator + ", Validation DateTime = " + validationDateTime;
    }
}