-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor jpa layer * Refactor jpa repository layer * Add JSON validation
- Loading branch information
1 parent
4642b99
commit a4350b1
Showing
30 changed files
with
584 additions
and
531 deletions.
There are no files selected for viewing
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
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
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
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
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
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
35 changes: 35 additions & 0 deletions
35
src/main/java/io/github/project/openubl/ublhub/models/jpa/entities/BaseEntity.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.github.project.openubl.ublhub.models.jpa.entities; | ||
|
||
import io.quarkus.hibernate.reactive.panache.PanacheEntityBase; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.NotNull; | ||
import java.util.Date; | ||
|
||
@MappedSuperclass | ||
public abstract class BaseEntity extends PanacheEntityBase { | ||
|
||
@NotNull | ||
@Temporal(TemporalType.TIMESTAMP) | ||
@Column(name = "created") | ||
public Date created; | ||
|
||
@Temporal(TemporalType.TIMESTAMP) | ||
@Column(name = "updated") | ||
public Date updated; | ||
|
||
@Version | ||
@Column(name = "version") | ||
public int version; | ||
|
||
@PrePersist | ||
public void prePersist() { | ||
created = new Date(); | ||
} | ||
|
||
@PreUpdate | ||
public void preUpdate() { | ||
updated = new Date(); | ||
} | ||
|
||
} |
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
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
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
Oops, something went wrong.