All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alon.spring.crud.domain.model.BaseEntity Maven / Gradle / Ivy

Go to download

Fornece implementação básica e expansível para criação API's CRUD com Spring Boot e Spring Data JPA.

There is a newer version: 1.0.9
Show newest version
package com.alon.spring.crud.domain.model;

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

import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.time.OffsetDateTime;

@MappedSuperclass
public abstract class BaseEntity implements Serializable {

    @CreationTimestamp
    private OffsetDateTime creationTimestamp;

    @UpdateTimestamp
    private OffsetDateTime updateTimestamp;

    public abstract ID getId();

    public abstract void setId(ID id);

    public OffsetDateTime getCreationTimestamp() {
        return creationTimestamp;
    }

    public void setCreationTimestamp(OffsetDateTime creationTimestamp) {
        this.creationTimestamp = creationTimestamp;
    }

    public OffsetDateTime getUpdateTimestamp() {
        return updateTimestamp;
    }

    public void setUpdateTimestamp(OffsetDateTime updateTimestamp) {
        this.updateTimestamp = updateTimestamp;
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy