Im trying to create a Domain Class Constructor that inherits another class properties dynamically. But I cannot get it to work properly.
Heres an example:
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.
}
}