//默认实体约束 grails.gorm.default.constraints = { '*'(nullable:true, blank:true) } //默认映射 grail…
def match(subject, closure) { def whenMap = [:], otherwise = null closure.when = { map -&g…
/** * @author petert * @since V1.0 * To save all logs into file if status is not success *…
//定义一个类 class GlobalService{ def grailsApplication def propertyMissing(String name){ grail…
//---------------------------------------------------------------------------------- // Ja…
def batchDelete(Class entityClass,ids){ entityClass.executeUpdate("delete ${entityClass.na…
if (args) { def className = args[0] def theClass = Class.forName(className) def theMetaCla…
package com.hongyuan.db import groovy.sql.Sql class DB { static main(args) { //创建查询对象 def …
class ShopService{ def grailsApplication def test(){ grailsApplication.mainContext.getBean…
def salary=7200; def tax=0.00; //只定义到了第5档,这个已经很难达到了 def taxRateMap=[3500:0.03,5000:0.1,800…
def list = [1,2,3,4] println (1 in list)// print true
def rand = new Random() def w = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] def …