Nested Filters
Typical filter patterns like /tasks?filter[name][EQ]=Super task`
work well for most use cases. This release brings further support for complex, nested filters through
JSON. It allows arbitrary nesting of AND, OR and NOT expressions. For example:
http://127.0.0.1:8080/projects?filter={"OR": {"name": "Great Project", "LE": {"id": 122}}}
More information is available in the documentation.
Revised JPA Setup
The JPA module has a long history with being the first module of Crnk. For this
reason it has shown a bit its age and other places evolved quite a bit in the meantime.
This release comes with a simplified, improved setup. Instead of configuring the JpaModule itself,
the application can specify repositories extending from JpaEntityRepositoryBase:
@Component
public class ScheduleRepositoryImpl extends JpaEntityRepositoryBase {
public ScheduleRepositoryImpl() {
super(ScheduleEntity.class);
}
}
The JPA module will detect those repositories and make them work like in the past with more explicit
configuration. The new setup has a number of advantages:
-
It is a regular repository like any other. In case of Spring Boot you can, for example,
inject it anywhere you like as it is a managed bean.
-
It makes use of the forwarding repository behaviors (see @JsonApiRelation) to
forward relationship calls to either side. So in case of customizations, only the
resource repositories have to be customized, the relationships will follow automatically.
-
Having a repository at hand allows to do any kind of customizations without having
to rely on decorators.
The old configuration mechanism is still in place and can continued to be used.
@JsonApiField support for relationships
Support for the readable, patchable, postable, deletable properties of @JsonApiField have been
added to relationships to complement the current support of basic attributes.
Support for parameterized super types
Fields in super type can now be parameterized through generics. Crnk will properly resolve those types
in subtypes.
Fix for relationship link handling
Self and related relationship links now make proper use of linking, such as paging.
A custom Spring Boot tag provider
Used to properly resolve URIs within the Spring MVC metrics mechanisms.