Skip to content

Commit

Permalink
Fix 157 inconsistent data handling with embedded entities
Browse files Browse the repository at this point in the history
  • Loading branch information
perplexhub committed Sep 11, 2024
1 parent 20e2cc4 commit c848608
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import javax.persistence.criteria.Path;
import javax.persistence.metamodel.Attribute;
import javax.persistence.metamodel.ManagedType;

import lombok.Value;

@Value(staticConstructor = "of")
class RSQLJPAContext {

private Path<?> path;
private Attribute<?, ?> attribute;
Path<?> path;
Attribute<?, ?> attribute;
ManagedType<?> managedType;

}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RSQLJPAContext findPropertyPath(String propertyPath, Path startRoot) {
RSQLJPAContext context = findPropertyPath(mappedProperty, root);
root = context.getPath();
attribute = context.getAttribute();
classMetadata = context.getManagedType();
} else {
if (!hasPropertyName(mappedProperty, classMetadata)) {
if (Modifier.isAbstract(classMetadata.getJavaType().getModifiers())) {
Expand Down Expand Up @@ -153,7 +154,7 @@ RSQLJPAContext findPropertyPath(String propertyPath, Path startRoot) {
accessControl(type, attribute.getName());
}

return RSQLJPAContext.of(root, attribute);
return RSQLJPAContext.of(root, attribute, classMetadata);
}

private String getKeyJoin(Path<?> root, String mappedProperty) {
Expand Down

0 comments on commit c848608

Please sign in to comment.