You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an entity have a collection of abstract classes as an attribute and is converted to its corresponding view with EntityViewManager#convert, the collection is converted as the entity view of the abstract class instead of their real class.
Here's a short example mapping for better understanding.
The entity classes
@EntitypublicclassPerson {
// other attributes// getters and setters omitted for brevityprivatelongid;
privateStringfirstName;
privateStringlastName;
privateList<Vehicle > vehicles;
}
@EntitypublicabstractclassVehicle {
// other attributes// getters and setters omitted for brevityprivatelongid;
privateStringmodel;
}
@EntitypublicclassCarextendsVehicle {
// other attributes// getters and setters omitted for brevityprivateintseatCapacity;
}
@EntitypublicclassBikeextendsVehicle {
// other attributes// getters and setters omitted for brevityprivateintcubicCapacity;
}
If I use EntityViewManager#convert on a Person instance to convert it to a PersonView, all vehicles will be converted to VehicleView instead of their respective CarView or BikeView.
The text was updated successfully, but these errors were encountered:
This issue is related to this discussion #1926
When an entity have a collection of abstract classes as an attribute and is converted to its corresponding view with
EntityViewManager#convert
, the collection is converted as the entity view of the abstract class instead of their real class.Here's a short example mapping for better understanding.
The entity classes
The views
If I use
EntityViewManager#convert
on aPerson
instance to convert it to aPersonView
, all vehicles will be converted toVehicleView
instead of their respectiveCarView
orBikeView
.The text was updated successfully, but these errors were encountered: