Skip to content

Releases: aleksadacic/DataQuerying

2.0.0

18 Feb 17:13
Compare
Choose a tag to compare

🚀 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:
      @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();
          }
      }
      ✅ Cleaner & more efficient than manual DTO conversion, and more powerful then Spring's original projection mechanism.
  • Refactored Query API 🚀

    • Removed executeQuery method as it can be found confusing.
    • Added Query<T> get(Specification<T> specification); which supports building on existing Specification objects.

🔥 Breaking Changes

  • Removed executeQuery Method
    • The executeQuery method has been removed in favor of Projection interface which contains all the necessary methods to replace the executeQuery method.

⚡ Upgrade Guide

  1. 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>
  1. 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

30 Jan 00:40
b903ea9
Compare
Choose a tag to compare
Update maven.yml