final ConfigurationService configService = serviceRegistry.getService( ConfigurationService.class ); this.mappingDefaults = new MappingDefaultsImpl( serviceRegistry );
final ConfigurationService configService = serviceRegistry.getService( ConfigurationService.class ); this.mappingDefaults = new MappingDefaultsImpl( serviceRegistry );
/** * Yuck. This is needed because JPA lets users define "global building options" * in {@code orm.xml} mappings. Forget that there are generally multiple * {@code orm.xml} mappings if using XML approach... Ugh */ public void apply(JpaOrmXmlPersistenceUnitDefaults jpaOrmXmlPersistenceUnitDefaults) { if ( !mappingDefaults.shouldImplicitlyQuoteIdentifiers() ) { mappingDefaults.implicitlyQuoteIdentifiers = jpaOrmXmlPersistenceUnitDefaults.shouldImplicitlyQuoteIdentifiers(); } if ( mappingDefaults.getImplicitCatalogName() == null ) { mappingDefaults.implicitCatalogName = StringHelper.nullIfEmpty( jpaOrmXmlPersistenceUnitDefaults.getDefaultCatalogName() ); } if ( mappingDefaults.getImplicitSchemaName() == null ) { mappingDefaults.implicitSchemaName = StringHelper.nullIfEmpty( jpaOrmXmlPersistenceUnitDefaults.getDefaultSchemaName() ); } } }
/** * Yuck. This is needed because JPA lets users define "global building options" * in {@code orm.xml} mappings. Forget that there are generally multiple * {@code orm.xml} mappings if using XML approach... Ugh */ public void apply(JpaOrmXmlPersistenceUnitDefaults jpaOrmXmlPersistenceUnitDefaults) { if ( !mappingDefaults.shouldImplicitlyQuoteIdentifiers() ) { mappingDefaults.implicitlyQuoteIdentifiers = jpaOrmXmlPersistenceUnitDefaults.shouldImplicitlyQuoteIdentifiers(); } if ( mappingDefaults.getImplicitCatalogName() == null ) { mappingDefaults.implicitCatalogName = StringHelper.nullIfEmpty( jpaOrmXmlPersistenceUnitDefaults.getDefaultCatalogName() ); } if ( mappingDefaults.getImplicitSchemaName() == null ) { mappingDefaults.implicitSchemaName = StringHelper.nullIfEmpty( jpaOrmXmlPersistenceUnitDefaults.getDefaultSchemaName() ); } }
public MetadataBuildingContextTestingImpl(StandardServiceRegistry serviceRegistry) { buildingOptions = new MetadataBuilderImpl.MetadataBuildingOptionsImpl( serviceRegistry ); bootstrapContext = new BootstrapContextImpl( serviceRegistry, buildingOptions ); mappingDefaults = new MetadataBuilderImpl.MappingDefaultsImpl( serviceRegistry ); metadataCollector = new InFlightMetadataCollectorImpl( bootstrapContext, buildingOptions ); objectNameNormalizer = new ObjectNameNormalizer() { @Override protected MetadataBuildingContext getBuildingContext() { return MetadataBuildingContextTestingImpl.this; } }; }