I have an instance of a pojo object with some properties set (lets say a customer with its name and id set). I know the object exists in the db.
Is there a way to complete the pojo with data from the db, i.e. load all other properties from the db into the pojo, but keep the ones that are already set -- they are assumed to be more up to date.
(I know, the alternative would be to load the object first and then set the values, but this is not an option here. I also know, I could write a query to retrieve all properies for that object individually and then copy them into the pojo, but I am looking for something more generic that would work for all my classes).
|