gorm


GORM findAll + cannot pass dynamic List as named parameter


I am getting the following exception at the following HQL.
java.util.ArrayList cannot be cast to java.lang.String.
Obviously I'm missing something but can't, can't figure it out. Can somebody please advise?
def methodA(List<String> key1List, List<String> key2List){
def results = DomainX.findAll("from DomainX x where (x.key1 in (:key1_s)) and (x.key2 in (:key2_s))",[key1_s:key1List, key2_s:key2List])
}
The following works but not the above one:
def methodA(List<String> key1List, List<String> key2List){
def results = DomainX.findAll("from DomainX x where (x.key1 in (:key1_s)) and (x.key2 in (:key2_s))",[key1_s:['ABC'], key2_s:['DEF']])
}
It was my mistake. key2List was like [[key2_a], [key2_b]]; GORM was expecting this to be a flattened list [key2_a, key2_b].

Related Links

How to avoid ImprovedNamingStrategy in joinTable in Grails
Grails 2 Show transient property that is an alias for id column
How to save GORM class with composite id made from its own field?
Grails - 2 domains and 1 form create/update/edit issues
Is there a belongsTo mixed syntax for GORM many-to-many and back-reference
Why do these Gradle tests throw exceptions?
In grails 2 when using multiple datasources, can I specify which datasource a criteria should use?
GORM methods are not accessible in Domain and Service classes
How to initialize the domain class properties with the values of another Domain class properties in grails
Grails Domain Embedded
How to get count of all items in a criteria GORM query
'Requested bean is currently in creation' on a domain object
GORM 1:N Association Cascades Delete Without belongsTo!
GNUstep - Can GORM open Interface Builder-created NIB files or not?
How to Alphabetically retrieve members of a list?
Gorm main window does not accept drag-and-drop

Categories

HOME
ibm-bluemix
pandas
coq
oracle11g
gremlin
comparison
syntax
gis
angular-ui-bootstrap
indesign
django-imagekit
virtualization
node-pdfkit
export-to-csv
leiningen
msp430
netflix
dosgi
after-effects
fatal-error
web-sql
core-text
language-agnostic
captiveportal
qhull
dynamic-featured-image
applozic
typo3-6.2.x
atlassian-crucible
srcset
directx-10
ecto
geopositioning
rotational-matrices
catalog
wpf-controls
bytecode-manipulation
ios5
disassembling
retina-display
gesture
elasticsearch-plugin
broadcastreceiver
ws-security
dynamic-reports
qcombobox
user-accounts
flickr-api
rainbowtable
osx-mavericks
chain-builder
drupal-6
forever
libusb-win32
qtwebview
jspdf-autotable
spring-cache
bind9
google-cdn
xcb
slicknav
mongocsharpdriver
impresspages
actionbardrawertoggle
ready-api
goose
jms2
marching-cubes
iiviewdeckcontroller
census
apache-commons-net
javax.mail
formatjs
winddk
eol
rebol3
valuechangelistener
mechanize-ruby
fmod
blending
dbconnection
batterylevel
jquery-mobile-dialog
pygit2
drools-planner
enter
custom-backend
spyware
yslow
wise
rtml

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App