Is there a 'not in' equivalent in GORM?

前端 未结 5 936
我寻月下人不归
我寻月下人不归 2021-02-15 10:21

Is this possible to convert in createCriteria()?

SELECT * FROM node WHERE (node.type = \'act\' AND nid NOT IN (SELECT nid FROM snbr_act_community)) LIMIT 10
         


        
5条回答
  •  再見小時候
    2021-02-15 10:58

    this is the solution :

    def resultat=EnteteImputationBudgetaire.createCriteria().get{
                between("dateDebutPeriode", dateDebut, dateFin)
    
                and{ eq 'natureImputationBudgetaire','FONCTIONNEMENT'  }
                maxResults(1)
            }
    
            def resultat2=ParametragePlanBudgetaire.createCriteria().list() {
                like('composantBudgetaire','6%')
                if(resultat?.details) {
                    not {
                        'in'('composantBudgetaire',resultat?.details?.imputationBudgetaire)
                    }
                }
            }
    

提交回复
热议问题