我想测试groovy/grails的SQL查询。回顾为什么SQL插入不起作用,我试图打印出该查询行。令人惊讶的是,甚至没有这个工作,所以我正在调查groovy中的字符串格式。如果有人有线索,请告诉我。groovy字符串格式化
println """INSERT INTO iu (version, path, uuid, name, description,
sourceversionfrom, sourceversionexto,
targetversionfrom, targetversionexto,
phase, directive, classname, methodname,
functionalarea_id, upgradepath_id, date_created,
last_updated, mark4delete, firstAvailable_id,
lastAvailable_id, uniqueid_id, elementcreateddate,
purpose, implementationdetails, userimpact)
VALUES (${this.version}, ${this.path}, ${this.uuid}, ${this.name},
${this.description}, ${this.sourceversionfrom},
${this.sourceversionexto}, ${this.targetversionfrom},
${this.targetversionexto}, ${this.phase}, ${this.directive},
${this.classname}, ${this.methodname}, $functionalarea_id,
$upgradepath_id, NOW(), NOW(), 0, ${this.projID},
${this.projID}, ${this.uniqueid_id},
${this.getElementCreatedDate()}, ${this.purpose},
${this.implementationDetails}, ${this.userImpact})"""
程序停止和该行
你是什么意思_“程序暂停和待命”_?它崩溃?它没有打印出来并挂起?顺便说一句:你发布的代码看起来很好...... – 2012-03-14 14:06:54