How to create criteria in groovy/grails for nested object?

前端 未结 1 1389
猫巷女王i
猫巷女王i 2021-02-14 06:46

I need help on creating hibernate criteria for nested object. For example :

class office{
    Integer id;
    OfficeDetails cmdData ;
}

class OfficeDetails {
           


        
1条回答
  •  南方客
    南方客 (楼主)
    2021-02-14 07:25

    See "querying associations" under the criteria section of the user guide:

    def criteria = {
      cmdData {
        region {
          eq('regionNum', regionNumber)
        }
      }
    }
    

    0 讨论(0)
提交回复
热议问题