Saturday, April 18, 2009

Grails Advanced Querying

www.piragua.com/msse
slide 18
/// grails criteria using hibernate

def c = Customer.createCriteria(){

return c.list(){
       servicelevel{ // alias maps to a table
                             eq('name', 'Gold')
                  }
        incidents{
               eq     
              }
}
}


/// 
def searchForCustomer( accountnumber, name, state){

def c = Customer.createCriteria(){
                  c.list(){
or{
like('name', 'h')
like('accountNumber', accountNumber
}
}
}

Transaction status:
slide 22 

No comments: