OK, so there doesn’t seem to be any very straightforward way out of this, either:
- we un-deprecate hbm.xml, since it's the only way to specify an explicit entity name,
- introduce a brand new XML mapping format, derived from orm.xml, but with the ability to specify entity names for entities and associations, or
- we deprecate the remaining methods of Session that accept a string entityName, since they’re only useful with the deprecated hbm.xml mapping format.
Note that it would not help to introduce new annotations, since you can’t define multiple mappings for a single class in annotations. (Nor you can you define mappings for {{Map}}s.) So what we’re contemplating here is losing:
- the ability to map a class multiple times with different entity names, and
- the ability to persist a Map.
|