Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Looping though domain?

boardtc

2008-08-28

Replies: Find Java Web Hosting

Author LoginPost Reply

I have a domain SampleModel where SampleModel.count() = 10. I want to loop
though each record in the domain SampleModel, SampleModel.each does not
appear to work. I can do:

    int i = 0
    while (i < SampleModel.count()) {
       println i
       // how print out a property from each sampleModel?
       i++
    }

Within the loop I try and do a SampleModel[i] and it does not like it. How
can I get at each item in the domain?
--
Sent from the groovy - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.