Re: xDev API Java example for using an Array in where clause
Hi Subramanyam Vummethala,
first I would encourage you to post this in the Connector/J forum (https://forums.mysql.com/list.php?39). However, I'll also try to shed some light on the subject.
As far as I know, at least from the official X DevAPI standpoint, it's not possible to bind multiple values (in the form of an array or something else) to a single X DevAPI expression placeholder.
So, with an "IN" expression, you need to explicitly lay out the entire set of placeholders you want to assign. Then you will have to map out all the values that should be assigned to those placeholders.
For instance, in your example:
find('Role IN [:role1, :role2, :role3, :role4]')
.bind('role1', 'PQR')
.bind('role2', 'XYZ')
.bind('role3', 'MNO')
.bind('role4', 'EFG')
Again, this is a limitation of the current X DevAPI specification, and I suggest you report it under the "MySQL Connectors: Document Store: DevAPI" category using the MySQL bug tracker (https://bugs.mysql.com/).
Hope it helps.
Thanks