I am doing some work with grails and my problem is that I can't never do the program go through the else part. My code is the following
while (pois.hasNext()){
def poi=pois.next()
def site = Site.get(poi.site)
if (!sites.contains(site.id)){
sites.add([id:site.id.toString(),name:site.name])
}else{
println("It has been previously added")
}
}
It should go through as I have checked my DB
Aucun commentaire:
Enregistrer un commentaire