Comparing Java Beans with BeanComparator
<p>I am trying to compare 2 beans of the same class and determine what part of the beans (if any) do not match. This may include beans with internally nested beans of another class, but for the most part the classes will be matching. Basically I want to derive the first class from the database and compare it with a new copy which will inevitably update the data in the database that is not already the same as whats currently in there.</p>

<p>So basically I will need to loop through each variable in the bean and compare it with bean 2. If it matches...move onto the next. If it does not match, return the index of the variable so I know what field to update in the database. </p>

<p>Is this something I can do with apache commons BeanComparator? Or will I have to come up with my own custom tool?</p>
