Yes, I know we can upcast or downcast in Java. But the type of the instance doesn't really seems to be change and it's giving me a problem.
E.g. class Foo{ int a, b; .. constructers, getters and setters }
class FooDTO extends Foo { ... }
FooDTO dto = FooDTO(1,2); Foo parent = (Foo) dto;
in hibernate, when saving the "parent", it's still think that it's a DTO object and can't be saved. Can I really turn a child instance into a parent instance?