Jan 15th, 2007, 09:35 AM
compareing javaBean tree?
i while back someone told me about dozer, which sounds really neat, for copy one java bean tree to another,
my question is this, is there something similar but instead of copying a tree, will tell me if the tree contains the same data?
meaning i will have the 2 instances of java bean trees and sending both to maybe a static method will return true or false?
maybe something that generates some big hashcode from all the values of the tree and then does the same thing to 2nd instance.
Jan 15th, 2007, 02:01 PM
How would that work though, how do you compare the equality? Surely you'd have to make all the beans implement equals.
Jan 16th, 2007, 12:49 AM
well since the tree is being saved with hibernate
they allready implement equls and hashcode.
the thing is that the tree is populated from an extenral data source then save to hibernate, we have to find out if that external data source was changed since the last time that tree was populated from it.
so the thing is to load the tree from hibernate, load another tree from that data source and compare them .