- Person.withCriteria{
- or{
- and{
- eq'lastName','Winter'
- eq'firstName','Johnny'
- }
- and{
- eq'lastName','Brown'
- eq'firstName','Jeff'
- }
- }
- }
上面的语言将对应如下SQL语句
- select
- this_.idasid0_0_,
- this_.versionasversion0_0_,
- this_.last_nameaslast3_0_0_,
- this_.first_nameasfirst4_0_0_
- from
- personthis_
- where
- (
- (
- this_.last_name='Winter'
- andthis_.first_name='Johnny'
- )
- or(
- this_.last_name='Brown'
- andthis_.first_name='Jeff'
- )
- )