我试图获取辅助域的记录,即与Vehicle域相关联的Vehicle Details Domain。
以下是我的域名类。
class MRVehicle {
String make
String brand
String model
String versione
String plateNumber
MRVehicleDetail vehicleDetail
static hasOne = [vehicleDetail : MRVehicleDetail]
static mapping = {
sort("id")
cache true
table name: "parco_veicoli"//, schema: "public"
id generator:'sequence', params:[sequence:'parco_veicoli_seq']
id column: "id", sqlType: "int4"
model column: "modello"
brand column: "marca"
versione column: "versione"
plateNumber column: "targa"
vehicleDetail cascade: 'all',fetch: 'join',unique: true
version false
}
}
和
class MRVehicleDetail {
Double vanMaxLengthExtVehicle
Double vanMaxWidthExtVehicle
Double vanMaxHeighExtVehicle
Double vanMaxLengthIntLoadComp
MRVehicle parco
static mapping = {
table name: "vehicle_detail"//, schema: "public"
id column: "id", sqlType: "int4" , generator: 'foreign', params: [property: 'parco']
parco column: 'id', insertable: false, updateable: false , sqlType: "int4"
vanMaxLengthExtVehicle column: "van_max_length_ext_vehicle"
vanMaxWidthExtVehicle column: "van_max_width_ext_vehicle"
vanMaxHeighExtVehicle column: "van_max_heigh_ext_vehicle"
vanMaxLengthIntLoadComp column: "van_max_length_int_load_comp"
version false
}
}
如果我尝试在我的GSP页面上获取车辆详细信息实例,请执行以下操作: -
${MRvehicle.vehicleDetail.vanMaxLengthExtVehicle}
执行上述行时,我的内存异常。