HHH-12948 Allow using a custom SessionFactoryOptionsBuilder to create a SessionFactoryBuilderImpl
This commit is contained in:
parent
8cf00ad3fd
commit
935601e29d
|
@ -45,12 +45,15 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement
|
||||||
private final SessionFactoryOptionsBuilder optionsBuilder;
|
private final SessionFactoryOptionsBuilder optionsBuilder;
|
||||||
|
|
||||||
public SessionFactoryBuilderImpl(MetadataImplementor metadata, BootstrapContext bootstrapContext) {
|
public SessionFactoryBuilderImpl(MetadataImplementor metadata, BootstrapContext bootstrapContext) {
|
||||||
this.metadata = metadata;
|
this( metadata, new SessionFactoryOptionsBuilder(
|
||||||
this.optionsBuilder = new SessionFactoryOptionsBuilder(
|
|
||||||
metadata.getMetadataBuildingOptions().getServiceRegistry(),
|
metadata.getMetadataBuildingOptions().getServiceRegistry(),
|
||||||
bootstrapContext
|
bootstrapContext
|
||||||
);
|
) );
|
||||||
|
}
|
||||||
|
|
||||||
|
public SessionFactoryBuilderImpl(MetadataImplementor metadata, SessionFactoryOptionsBuilder optionsBuilder) {
|
||||||
|
this.metadata = metadata;
|
||||||
|
this.optionsBuilder = optionsBuilder;
|
||||||
if ( metadata.getSqlFunctionMap() != null ) {
|
if ( metadata.getSqlFunctionMap() != null ) {
|
||||||
for ( Map.Entry<String, SQLFunction> sqlFunctionEntry : metadata.getSqlFunctionMap().entrySet() ) {
|
for ( Map.Entry<String, SQLFunction> sqlFunctionEntry : metadata.getSqlFunctionMap().entrySet() ) {
|
||||||
applySqlFunction( sqlFunctionEntry.getKey(), sqlFunctionEntry.getValue() );
|
applySqlFunction( sqlFunctionEntry.getKey(), sqlFunctionEntry.getValue() );
|
||||||
|
|
Loading…
Reference in New Issue