TRUNK-3844 Correct BaseOpenmrsObject equals

I have referred to rafals pr for this and tried reopening the ticket for merge. Kindly review it and give the necessary reviews. :)