0

完了していない投票を表示したいのですが、現在のユーザーはこれらの投票に関与していません。

私はこれらの基準から始めました:

def displayAdherantByVote(){
            def adherant=springSecurityService.currentUser.username

             def elec=Election.withCriteria(){
              createAlias("adherant", "adherant")
                 createAlias("candidature", "candidature")

                       eq('adherant.firstName',adherant)

               projections{
                     property('candidature.vote')

               }


def newvote(){
        def votes= Vote.createCriteria()
        def results=votes.list{
         ge("enddateelection",new Date())

           le("startdateelection",new Date())
        }
4

1 に答える 1

0

Gormで否定を行う必要がある場合は、NOT次を使用できます。

ne (2 つの値が等しくないかどうかを確認します)

neProperty (2 つのプロパティが等しくないかチェック)

したがって、あなたの場合currentUser、基準を使用して投票に関与していないかどうかを確認します。

neProperty("currentUser", "user")
于 2013-06-10T19:11:27.857 に答える