Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Dec 18, 2024
1 parent 8ebca25 commit ffbdff0
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public JpaFilterConverter(EntityManager entityManager) {
}

/**
* Converts the given filter specification into a JPA filter
* specification for the specified entity class.
* Converts the given filter specification into a JPA filter specification
* for the specified entity class.
* <p>
* If the filter contains {@link PropertyStringFilter} instances, their
* properties, or nested property paths, need to match the structure of the
Expand Down Expand Up @@ -60,17 +60,17 @@ public <T> Specification<T> toSpec(Filter rawFilter, Class<T> entity) {
filter.getPropertyId());
return new PropertyStringFilterSpecification<>(filter, javaType);
} else {
throw new IllegalArgumentException("Unknown filter type "
+ rawFilter.getClass().getName());
throw new IllegalArgumentException(
"Unknown filter type " + rawFilter.getClass().getName());
}
}

private Class<?> extractPropertyJavaType(Class<?> entity,
String propertyId) {
if (propertyId.contains(".")) {
String[] parts = propertyId.split("\\.");
Root<?> root = entityManager.getCriteriaBuilder().createQuery(entity)
.from(entity);
Root<?> root = entityManager.getCriteriaBuilder()
.createQuery(entity).from(entity);
Path<?> path = root.get(parts[0]);
int i = 1;
while (i < parts.length) {
Expand All @@ -79,8 +79,8 @@ private Class<?> extractPropertyJavaType(Class<?> entity,
}
return path.getJavaType();
} else {
return entityManager.getMetamodel().entity(entity).getAttribute(propertyId)
.getJavaType();
return entityManager.getMetamodel().entity(entity)
.getAttribute(propertyId).getJavaType();
}
}

Expand Down

0 comments on commit ffbdff0

Please sign in to comment.