Last active
July 18, 2020 10:01
-
-
Save ehabqadah/fa1eef840fa6f4949ffa1b8e75d6b43a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* <p> Root entity for object persistence via JPA.</p> | |
* | |
* @author Ehab Qadah | |
*/ | |
@MappedSuperclass | |
public abstract class BaseEntity { | |
@Id | |
@GeneratedValue(generator = "custom-generator", | |
strategy = GenerationType.IDENTITY) | |
@GenericGenerator( | |
name = "custom-generator", | |
strategy = "com.qadah.demo.data.model.id.generator.BaseIdentifierGenerator") | |
protected String id; | |
@CreationTimestamp | |
@Column(name = "created_at", updatable = false, nullable = false) | |
protected Instant createdAt; | |
@UpdateTimestamp | |
@Column(name = "modified_at") | |
protected Instant modifiedAt; | |
@Column | |
@Version | |
protected int version; | |
// standard setters and getters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment