Releases: aleksadacic/DataQuerying
Releases · aleksadacic/DataQuerying
2.0.0
🚀 Release v2.0.0
📅 Release Date: February 18, 2025
🎉 This major release introduces powerful enhancements for dynamic querying in Spring Data JPA while simplifying the API.
✨ New Features
-
Projection Interface Support
- You can now map query results directly to DTOs or interfaces without additional conversions.
- Example:
✅ Cleaner & more efficient than manual DTO conversion, and more powerful then Spring's original projection mechanism.
@RestController @RequestMapping("/users") public class UserController { @Autowired private ProjectionFactory projectionFactory; @Autowired private UserRepository userRepository; @PostMapping("/search") public List<UserMinimalDto> getAllMinimal() { return projectionFactory.create(User.class, UserMinimalDto.class).findAll(); } }
-
Refactored Query API 🚀
- Removed
executeQuery
method as it can be found confusing. - Added
Query<T> get(Specification<T> specification);
which supports building on existingSpecification
objects.
- Removed
🔥 Breaking Changes
- Removed executeQuery Method
- The
executeQuery
method has been removed in favor ofProjection
interface which contains all the necessary methods to replace theexecuteQuery
method.
- The
⚡ Upgrade Guide
- Maven Dependency Update
- Update your pom.xml to use the latest version:
<dependency>
<groupId>dev.rosemarylab.dataquerying</groupId>
<artifactId>DataQuerying</artifactId>
<version>2.0.0</version>
</dependency>
- Replace
executeQuery
calls
- Switch to Projections for specifying the entity type, return type, and optionally filter data with or without pagination.
Query<User> query = Query.where("name", "John");
return projectionFactory.create(User.class, UserMinimalDto.class).findAll(query.buildSpecification());
📢 Feedback & Contributions
We'd love to hear your feedback! Feel free to open an issue or submit a PR.
🚀 Happy Querying!
🔥 DataQuerying v2.0.0
v1.0.0
Update maven.yml