We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've the following Panache Entity, and I'm tring to use the array_includes function, however it doesn't accept an array as a parameter.
array_includes
@Entity class MyEntity extends PanacheEntity { @Array(length = 20) public String[] accounts; // doesn't work public static boolean accountNotExists_v1(String[] users) { return count("array_includes(accounts, ?1)", users) == 0; } // does work public static boolean accountNotExists_v2(String[] users) { var arrayParam = Arrays.stream(users) .map("'%s'"::formatted) .collect(joining(",", "array(", ")")); => will return 'array('user1', 'user2', ...) return count("array_includes(accounts, %s)".formatted(arrayParam)) == 0; } }
I think the issue is with Hibernate and the documentation doesn't mention anything on the usage.
I'd expect that passing an array or a collection, should work.
I've to manually transform it into this form: array('val1', 'val2', ...), and pass it as a string and this is cumbersome.
array('val1', 'val2', ...)
No response
uname -a
ver
java -version
3.15.2 & Hibernate 6.6.x
mvnw --version
gradlew --version
The text was updated successfully, but these errors were encountered:
/cc @FroMage (panache), @loicmathieu (panache)
Sorry, something went wrong.
No branches or pull requests
Describe the bug
I've the following Panache Entity, and I'm tring to use the
array_includes
function, however it doesn't accept an array as a parameter.I think the issue is with Hibernate and the documentation doesn't mention anything on the usage.
Expected behavior
I'd expect that passing an array or a collection, should work.
Actual behavior
I've to manually transform it into this form:
array('val1', 'val2', ...)
, and pass it as a string and this is cumbersome.How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.15.2 & Hibernate 6.6.x
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: