Announcement Announcement Module
No announcement yet.
compareing javaBean tree? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    How would that work though, how do you compare the equality? Surely you'd have to make all the beans implement equals.


    • #3
      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 .