Implement an "additional mapping" contributor SPI. Basically what {{AdditionalJaxbMappingProducer}} is today, but allowing additional mechanisms of contribution.
{code:java}interface AdditionalMappingContributor { void contributeMappings( AdditionalMappingContributions contributions, InFlightMetadataCollector metadata, ResourceStreamLocator resourceStreamLocator, MetadataBuildingContext buildingContext); }
interface MappingContributions AdditionalMappingContributions { void contributeEntity(Class<?> entityType); void contributeBinding(InputStream xmlStream); void contributeBinding(JaxbEntityMappings mappingJaxbBinding); void contributeBinding(JaxbHbmHibernateMapping hbmJaxbBinding); void contributeTable(Table table); void contributeSequence(Sequence sequence); void contributeAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject); }{code}
Ultimately will support contributing {{org.hibernate.mapping.PersistentClass}} references as well, though the exact semantics of that need to be worked out. E.g. what all gets auto-handled? Table? Secondary tables? etc |
|