A more parsimonious solution (perhaps) would be to simply add the valid name to NameSet.addName(...),
after the name is validated by DBDictionary.makeNameValid() which also ensures uniqueness against the name set,
The issue of naming is getting trickier with several aspects
a) The logic/protocol of naming of database elements (Table/Column/Schema/Sequence) is somewhat well-spread at different parts
b) few assumptions are implicit (like full name of a table is a concatenation of schema.table – but MySQL, for example, will not like that)
c) other 'container' things often cache these elements by their names but these names may get shortened/modified because of database length restrictions/keyword clash
– all these make naming a complex issue. One can see when methods like MappingDefaults.correctName() appears – as if we know we have done mistakes
d) the proverbial straw on the camel's back is the new JPA 2.0 requirement of these names be optionally quoted/delimited with default/platform specific quote characters.
In light of all the above, having a NameSet._subNames and adding/resetting it everywhere may add to the complexities.