There is code in InFlightMetadataCollector.addIdentifierGenerator that purports to detect duplicate named generator definitions. In fact this is almost completely useless, since id generator names are global (they usually correspond to named objects in the database) but there is a new instance of InFlightMetadataCollector for each entity class. This means that we fail to inform the user when their dupe id generator definition is ignored. You can see this in action in our very own SequenceGeneratorIncrementTest which should fail, since there are conflicting definitions of the generator named ID_GENERATOR but actually doesn’t, since the first definition gets reused by the second entity. This is bad. |