Hi there,
I am looking for a solution for the following problem.
I am writing a test for a hibernate mapped value object copy constructor.
Now, as the object is has many ancestors and many data members (Sets, Lists, other Value Objects) I want to make sure that the copy constructor has deep copied them hibernate wise.
This means the following:
The content is copied but the id field for all copied value objects is null (if not we get an update instead of insert).
The way to do it if using reflection to scan the object and its data members recursively taking into account Collection data members, primitives etc.
Does anyone know a framework I can use?
I need a method that gets the POJO, the field name ("id") and the value (null) and returns false if one of the ids is not null.
Thanks a lot guys,
David
|