Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for 29475 Element Collection issue #30578

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

ajaypaul-ibm
Copy link
Contributor

@ajaypaul-ibm ajaypaul-ibm commented Jan 17, 2025

Here is the output of this test. Entity attribute names ending in "EC" use ElementCollection. The others have the same types but don't use ElementCollection:

SELECT intArray FROM ECEntity WHERE id=?1
getResultList returned a java.util.Vector
    elements are of type int[]
            contents are [[14, 12, 1]]

SELECT longList FROM ECEntity WHERE id=?1
getResultList returned a java.util.Vector
    elements are of type java.util.ArrayList
            contents are [[14, 12, 1]]

SELECT stringSet FROM ECEntity WHERE id=?1
getResultList returned a java.util.Vector
    elements are of type java.util.ImmutableCollections$SetN
            contents are [[fourteen, twelve, one]]

SELECT longListEC FROM ECEntity WHERE id=?1
getResultList returned a java.util.Vector
    elements are of type java.lang.Long
            contents are [14, 12, 1]

SELECT longListEC FROM ECEntity WHERE id LIKE ?1
getResultList returned a java.util.Vector
    elements are of type java.lang.Long
            contents are [14, 12, 1, 14, 12, 2]

SELECT longList FROM ECEntity WHERE id LIKE ?1
getResultList returned a java.util.Vector
    elements are of type java.util.ArrayList
            contents are [[14, 12, 1], [14, 12, 2]]

SELECT stringSetEC FROM ECEntity WHERE id LIKE ?1
getResultList returned a java.util.Vector
    elements are of type java.lang.String
            contents are [fourteen, twelve, one, fourteen, twelve, two]

SELECT stringSet FROM ECEntity WHERE id LIKE ?1
getResultList returned a java.util.Vector
    elements are of type java.util.ImmutableCollections$SetN
            contents are [[fourteen, twelve, one], [fourteen, twelve, two]]

SELECT stringSetEC FROM ECEntity WHERE id=?1
getResultList returned a java.util.Vector
    elements are of type java.lang.String
            contents are [fourteen, twelve, one]

<<< END: testElementCollecti

If EclipseLink wants to reject this outright because the Jakarta Persistence specification does not require element collections to be selected by JPQL queries, that would be perfectly fine. But if EclipseLink doesn't reject it, it at least needs to get the behavior correct and return valid results.

@ajaypaul-ibm ajaypaul-ibm requested a review from njr-11 January 17, 2025 15:31
@ajaypaul-ibm
Copy link
Contributor Author

ajaypaul-ibm commented Jan 17, 2025

#build (view Open Liberty Personal Build - ✅ completed successfully!)

Note: Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Code analysis and actions

DO NOT DELETE THIS COMMENT.
  • 2 FAT files were changed, added, or removed.

  • Check that the build did not break the affected FAT suite(s).

  • Please describe in a separate comment how you tested your changes.

njr-11
njr-11 previously approved these changes Jan 17, 2025
Copy link
Contributor

@njr-11 njr-11 left a comment

Choose a reason for hiding this comment

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

Approving. Looks like a very consistent copy of #30575 for JPA.

@ajaypaul-ibm
Copy link
Contributor Author

ajaypaul-ibm commented Jan 20, 2025

#build (view Open Liberty Personal Build - ✅ completed successfully!)

Note: Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Code analysis and actions

DO NOT DELETE THIS COMMENT.
  • 2 FAT files were changed, added, or removed.

  • Check that the build did not break the affected FAT suite(s).

  • Please describe in a separate comment how you tested your changes.

@ajaypaul-ibm
Copy link
Contributor Author

@njr-11 I have incorporated the changes as per the review comments. Kindly take a look and approve at your convenience. Thank you!

@ajaypaul-ibm ajaypaul-ibm merged commit aa2801a into OpenLiberty:integration Jan 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants