Skip to content

Commit

Permalink
Adds support for jakarta persistence annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahli authored and jqno committed Jan 25, 2022
1 parent bf356df commit 67f398b
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,31 @@ public boolean validate(
false,
"javax.persistence.Entity",
"javax.persistence.Embeddable",
"javax.persistence.MappedSuperclass"
"javax.persistence.MappedSuperclass",
"jakarta.persistence.Entity",
"jakarta.persistence.Embeddable",
"jakarta.persistence.MappedSuperclass"
),

/**
* Fields in JPA Entities that are marked @Transient should not be included in the
* equals/hashCode contract, like fields that have the Java transient modifier. EqualsVerifier
* will treat these the same.
*/
TRANSIENT(true, "javax.persistence.Transient"),
TRANSIENT(true, "javax.persistence.Transient", "jakarta.persistence.Transient"),

/**
* Fields in JPA Entities that are marked @Id or @EmbeddedId are usually part of the entity's
* surrogate key. EqualsVerifier will therefore assume that it must not be used in the
* equals/hashCode contract, unless {@link Warning#SURROGATE_KEY} is suppressed.
*/
ID(false, "javax.persistence.Id", "javax.persistence.EmbeddedId") {
ID(
false,
"javax.persistence.Id",
"javax.persistence.EmbeddedId",
"jakarta.persistence.Id",
"jakarta.persistence.EmbeddedId"
) {
@Override
public void postProcess(Set<Class<?>> types, AnnotationCache annotationCache) {
types.forEach(t -> annotationCache.addClassAnnotation(t, ID));
Expand Down

0 comments on commit 67f398b

Please sign in to comment.