Soak beans overnight in plenty of cold water; or boil 2 minutes, cover, and let stand 1 hour.
Drain beans and transfer to large saucepan. Add enough cold water to cover beans generously. Stir in onion. Boil uncovered 10 minutes. Reduce heat to medium-low; simmer uncovered until beans are tender, 1 to 1-1/2 hours.
Combine all remaining ingredients except in ham in mixing bowl and set aside.
Heat oven to 350 degrees.
Drain beans, reserving 1 cup liquid. Transfer bean to medium casserole, pour sauce over beans, and stir to coat. Stir in ham and reserved liquid and spread mixture evenly in casserole.
Bake covered about 35 minutes, then remove cover and continue to bake until liquid is almost completely absorbed, about 1-1/2 hurs.