Skip to content

Conversation

@ng-galien
Copy link
Collaborator

Fix #157

Description:

There appears to be an issue with handling embedded entities using RSQL. When querying for embedded entities, the behavior differs depending on whether or not a mapping for an embedded entity is set.

Steps to Reproduce:

  • Clone the repository rsql-embedded-bug-repository.
  • Follow the README instructions to set up and run the project.
  • Execute the provided test cases or run the application to reproduce the issue.

Expected Behavior:

Querying with or without remapping should be possible on embedded entities.

Actual Behavior:

Querying with mappings on embedded entities leads to an UnknownPropertyException. Without remapping the correct data is returned.

Additional Information:

Potential Impact:

This bug impacts any application relying on RSQL queries for embedded entities, particularly when using property mapping functionality, potentially causing data consistency issues and incorrect data retrieval.

The RSQLJPAContext class has been updated to include a new field 'managedType', while RSQLJPAPredicateConverter class now also returns 'managedType'. The returned context from 'findPropertyPathInternal' method in RSQLJPAPredicateConverter is now being utilized to get the 'managedType'.
New model classes for `AccountEntity`, `AddressEntity`, and `AddressHistoryEntity` have been created. The `AccountRepository` interface has also been added. Accompanying these, several tests were introduced into `RSQLJPASupportTest` to ensure correct functionality.
The access modifiers for the path, attribute, and managedType variables in the RSQLJPAContext class have been updated. These were previously set as private, but have now been made package-private.
Replaced manual getters and setters in the account, address, and address history entities with Lombok annotations. This simplifies the code by using the @Getter and @Setter annotations to generate these methods automatically, making the entities more readable and maintainable.
Copy link

@tobjohnbx tobjohnbx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works fine <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: Inconsistent Data Handling with Embedded Entities

3 participants