我有一些扩展父类的 java 类。从父类中,我希望从子类中调用几个方法。有人知道怎么做这个吗?谢谢
例子。
@MappedSuperclass
public class LookupBaseEntity {
private List<VehicleConfiguration> vehicleConfigurations;
public VehicleConfiguration getVehicleConfiguration() {
return vehicleConfiguration;
}
public void setVehicleConfigurations(List<VehicleConfiguration> vehicleConfigurations) {
this.vehicleConfigurations = vehicleConfigurations;
}
}
儿童班
@Entity
public class VehicleYear extends LookupBaseEntity {
@OneToMany(mappedBy = "vehicleYear")
private List<VehicleConfiguration> vehicleConfigurations;
public VehicleYear() {
}
public List<VehicleConfiguration> getVehicleConfigurations() {
return vehicleConfigurations;
}
public void setVehicleConfigurations(List<VehicleConfiguration> vehicleConfigurations) {
this.vehicleConfigurations = vehicleConfigurations;
}
}