|
Gunnar Morling In general I'd prefer to note be having this discussion mere days before the planned first Beta release date. Changing a half-buried SPI's contract? Ok. Changing the main bootstrap contract methods significantly? That's a bit much.
As for an approach allowing MetadataBuilder to "call an SPI to alter the configuration"... that exists. I stove to have such a "hook point" at every junction in the bootstrapping process. Here, we have org.hibernate.boot.spi.MetadataBuilderContributor:
public interface MetadataBuilderContributor {
public void contribute(MetadataBuilder metadataBuilder);
}
It is called just after the MetadataBuilder has been instantiated (which includes reading any values from settings), but before it returned from MetadataSources#getMetadataBuilder. As you can see it is passed the builder reference. The intention is that the MetadataBuilderContributor would call any of the "apply" methods. There is currently no way to check whether there is any already-set-value for any of these. Not sure if thats a problem for y'all.
|