-
-
Save fromeroj/4003212 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static SeccionCedula seccionCedula | |
static Pregunta pregunta | |
static Set<Pregunta> p | |
def static reactivosBase(Session session, String pregunta_id, String seccion_nombre){ | |
seccionCedula = new SeccionCedula() | |
pregunta = new Pregunta() | |
seccionCedula.nombre = seccion_nombre | |
pregunta_id.split(",").forEach([ | |
println("****split id's: "+ it) | |
pregunta.id = try {Integer::parseInt(it)} catch (Exception e) { 0 } | |
seccionCedula.obligatorias.add(pregunta) | |
) | |
]) | |
session.saveOrUpdate(seccionCedula) | |
return seccionCedula | |
} |
def static reactivosBase(Session session, String preguntas_ids, String seccion_nombre){
val seccionCedula = new SeccionCedula
seccionCedula.nombre = seccion_nombre
preguntas_ids.split(",").forEach([
val pregunta=new Pregunta()
pregunta.id = try {Integer::parseInt(it)} catch (Exception e) {0}
if(pregunta.id!=0)seccionCedula.obligatorias.add(pregunta)
])
session.saveOrUpdate(seccionCedula)
seccionCedula
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
static SeccionCedula seccionCedula
static Pregunta pregunta
static Set p
def static reactivosBase(Session session, String preguntas_ids, String seccion_nombre){
seccionCedula = new SeccionCedula()
seccionCedula.nombre = seccion_nombre
preguntas_ids.split(",").forEach([
println("****split id's: "+ it)
val pregunta=new Pregunta()
pregunta.id = try {Integer::parseInt(it)} catch (Exception e) { 0 }
if(pregunta.id!=0)seccionCedula.obligatorias.add(pregunta)
])
session.saveOrUpdate(seccionCedula)
return seccionCedula
}