--
You received this message because you are subscribed to the "Groovy Users of Minnesota" group.
To post to this group, send email to groo...@googlegroups.com
To unsubscribe from this group, send email to groovymn-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/groovymn?hl=en
On Dec 29, 7:08 pm, Christopher Bartling <chris.bartl...@gmail.com>
wrote:
> I'd try the Hibernate site.
>
> -- chris --
>
> Sent from my iPhone
>
> On Dec 29, 2009, at 6:07 PM, Colin Harrington <colin.harring...@gmail.com
> > colin.harring...@gmail.com
The discriminator column is a String with the name 'class', so it'd be
eq("class", CreditAccount.name)
Burt
> How do I use criteria to query associations of a specific type/subclass?
>
> Account {
> static hasMany = [transactions: Transaction]
> ...
> }
>
> CreditAccount extends Account {
> ...
> String filterableProperty
> }
>
> class Transaction {
> static belongsTo = [account: Account]
> ...
> BigDecimal amount
> }
>
> How do I find transactions belonging to a CreditAccount (with a filterable
> property) ?
>
> I want to do something like:
>
> def criteria = Transaction.createCriteria()
> criteria.list {
> accounts {
> eq("classOfAccount", CreditAccount) *//This is wrong / How do I
> filter on the class?*
> eq("filterableProperty", "foo")
> }
> ge('amount', 100)
> }
>
> I couldn't find anything about how to do this in the User Guide, Grails in
> Action or the Definitive Guide to Grails. and I'm not sure I know where to
> look next.
>
> Thank you,
>
> Colin Harrington
> colin.ha...@gmail.com
> 612.804.5472
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email