info.novatec.testit.livingdoc.samples.application.phonebook.AbstractEntity Maven / Gradle / Ivy
package info.novatec.testit.livingdoc.samples.application.phonebook;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
/**
* Abstract Entity Class. All POJOS have to exntend it. Provides the versioning
* and the Primary key.
*
* Copyright (c) 2006 Pyxis technologies inc. All Rights Reserved.
*
* @author JCHUET
*/
@SuppressWarnings("serial")
@MappedSuperclass
public abstract class AbstractEntity implements Serializable {
private Long id;
private Integer version;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
@Version
@Column(name = "VERSION")
public Integer getVersion() {
return this.version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy