lihaoningxia 2012-08-16
importjava.util.Date;
//知识库类别
classKnowledgeType{
//属性名称
Stringsortname
//属性描述
Stringsortdesc
//预留字段
Stringsortnuber
DatedateCreated
DatelastUpdated
//建立父节点
staticbelongsTo=[parent:KnowledgeType];
//建立子结点,多个子属性
statichasMany=[childrens:KnowledgeType];
staticconstraints={
parent(nullable:true)
}
StringtoString(){
sortname
}
}
写上staticconstraints={
parent(nullable:true)要不会出错,定义父节点可以为空