io.coodoo.framework.jpa.boundary.entity.AbstractRevisionDatesEntity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of coodoo-jpa-essentials Show documentation
Show all versions of coodoo-jpa-essentials Show documentation
Essential JPA entities and functionality
package io.coodoo.framework.jpa.boundary.entity;
import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import io.coodoo.framework.jpa.control.JpaRevisionEntityListener;
/**
* Base entity providing identification and revision information.
*
*
*
*
*
*
* Fields
* ID
* Creation Date
* Update Date
*
*
* Name
* id
* createdAt
* updatedAt
*
*
* Type
* Long
* LocalDateTime
* LocalDateTime
*
*
* Column name
* id
* created_at
* updated_at
*
*
*
* @author coodoo GmbH (coodoo.io)
*/
@SuppressWarnings("serial")
@MappedSuperclass
@EntityListeners(JpaRevisionEntityListener.class)
public abstract class AbstractRevisionDatesEntity extends AbstractEntity {
@Column(name = "created_at", nullable = false)
protected LocalDateTime createdAt;
@Column(name = "updated_at")
protected LocalDateTime updatedAt;
public LocalDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(LocalDateTime createdAt) {
this.createdAt = createdAt;
}
public LocalDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(LocalDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public String toString() {
return "AbstractRevisionDatesEntity [id=" + id + ", createdAt=" + createdAt + ", updatedAt=" + updatedAt + "]";
}
}