DBModel.java 1.88 KB
/*
 * Copyright Codecrew Ry
 * 
 * All rights reserved.
 * 
 * This license applies to any software containing a notice placed by the 
 * copyright holder. Such software is herein referred to as the Software. 
 * This license covers modification, distribution and use of the Software. 
 * 
 * Any distribution and use in source and binary forms, with or without 
 * modification is not permitted without explicit written permission from the 
 * copyright owner. 
 * 
 * A non-exclusive royalty-free right is granted to the copyright owner of the 
 * Software to use, modify and distribute all modifications to the Software in 
 * future versions of the Software. 
 * 
 */
package fi.codecrew.moya.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import fi.codecrew.moya.utilities.jpa.ModelInterface;

@Entity
@Table(name = "db_models")
public class DBModel implements ModelInterface {
    private static final long serialVersionUID = 5073284536090477221L;

    public static final String ID_COLUMN = "id";

    @Id
    @Column(name = ID_COLUMN, nullable = false)
	private Integer id;

	@Column(name = "revision", nullable = false)
	private Integer revision;

	@Column(name = "applied_at")
	@Temporal(TemporalType.TIMESTAMP)
	private Date appliedAt = new Date();

	@Override
	public final Integer getId() {
		return id;
	}

	@Override
	public final void setId(Integer id) {
		this.id = id;
	}

	public Date getAppliedAt() {
		return appliedAt;
	}

	public void setAppliedAt(Date appliedAt) {
		this.appliedAt = appliedAt;
	}

	public Integer getRevision() {
		return revision;
	}

	public void setRevision(Integer revision) {
		this.revision = revision;
	}
}