Comparisons of generations should be done based on id

Using == to test equality of Generation objects is fine,
but comparisons like < use the meaningless default
comparator.  Compare based on the id column instead.
Fix construction of an unexpected Exception message