Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7692

Error parsing GroovyRowResult to Domain (Groovy 2.4.4)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.4
    • None
    • SQL processing
    • None

    Description

      When we do a parse from GroovyRowResult class to a domain class (Cuser in the example below) only columns with the same name in database and domain are parsed. For example:

      Domain field 'name' -> Database column 'name' -> Parsed successfully
      Domain field 'photoId' -> Database column 'photo_id' -> Not parsed (null value)

      Sql sql = new Sql(dataSource)
      
      List<GroovyRowResult> candidates = sql.rows("{call bestCandidatesForClientSelection(?,?,?,?,?,?,?)}", [cuser.id, task.tasktype.id, task.id, task.latitude, task.longitude, 12, 5])
      
      candidates.each { candidate ->
          result.add(new Cuser(candidate ))
      }
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            danielsamper Daniel Samper
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: