儿童的名单我都historystep的有两个领域类一个多对一显示与父ID
1)
package opfwflowmonitor
import java.io.Serializable;
class OpfWF_Entry implements Serializable{
String name
Date create_date
static hasOne=[siteName:OpfWF_SiteName, currentStepStatus:OpfWF_CurrentStepStatus,currentStepName:OpfWF_CurrentStepName]
static hasMany = [historySteps:OpfWF_HistoryStepsInfo]
static mapping = {
table name: "OS_WFENTRY", schema: "GSI"
version false
cache true
historySteps cache:true
sort id:"desc"
columns{
name column:'NAME'
create_date column:'CREATE_DATE'
}
}
}
而且
package opfwflowmonitor
import java.util.Date;
class OpfWF_HistoryStepsInfo {
Long entry_id
Long action_id
Long step_id
Date start_date
Date finish_date
String status
static belongsTo = [historyEntry: OpfWF_Entry]
static mapping = {
table name: "OS_HISTORYSTEP", schema: "GSI"
version false
cache true
historyEntry cache: true
sort id:"desc"
id generators: 'assigned'
columns{
id column:'ID'
action_id column:'ACTION_ID'
step_id column:'STEP_ID'
start_date column:'START_DATE'
finish_date column:'FINISH_DATE'
status column:'STATUS'
// ENTRY_ID column:'ENTRY_ID'
}
historyEntry column:'entry_id'
historyEntry insertable:false
historyEntry updateable:false
}
String toString() { "$id" }
}
我该怎么让列表所有属性,当我选择OpfWF_Entry?
当用户点击OpfWF_Entry表记录列表时,如何获取子表的列表(包括历史表的所有属性)。
您是使用默认脚手架还是自己编写视图? – 2012-01-10 18:05:40
由控制器通过grails自动生成的默认脚手架。 – element40 2012-01-10 18:09:32
你真的应该遵循一般的java编码标准。下划线是来自不区分大小写的数据库(如Oracle)的传统约定。你真的不应该在Java/Groovy中使用它们......永远。好吧,常量可以有下划线,但无论如何。 http://www.oracle.com/technetwork/java/codeconvtoc-136057.html – dbrin 2012-01-11 06:20:53