我試圖創建一個動態繼承其他類屬性的域類構造函數。但我無法讓它正常工作。從基類繼承Grails域類屬性
這裏有一個例子:
class Example1 {
String name;
String location;
}
class Example2 extends Example1 {
String status;
public Example2 (Example1 orig){
// Code here to set this.name and this.location to name and location from orig
// dynamically, so adding a field in Example1 does not require me to add that
// field here.
}
}
我試過了,說我必須要耐心等待8個小時:( – Gregor
是的,有時間限制。也許明天回來吧:) –