package org.academiadecodigo.bootcamp.fxlogin.model;

import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.util.Date;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

@MappedSuperclass
public class AbstractModel {
    @Version
    private Integer version;

    @CreationTimestamp
    private Date created;

    @UpdateTimestamp
    private Date updated;

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }
}
