Class MetadataBuilderImpl
- All Implemented Interfaces:
MetadataBuilder,TypeContributions,MetadataBuilderImplementor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionMetadataBuilderImpl(MetadataSources sources) MetadataBuilderImpl(MetadataSources sources, StandardServiceRegistry serviceRegistry) -
Method Summary
Modifier and TypeMethodDescriptionapplyAccessType(AccessType implicitCacheAccessType) Specify the second-level access-type to be used by default for entities and collections that define second-level caching, but do not specify a granular access-type.Specify a particular ArchiveDescriptorFactory instance to use in scanning.applyAttributeConverter(AttributeConverter<?, ?> attributeConverter, boolean autoApply) Adds anAttributeConverterinstance, explicitly indicating whether to auto-apply it.<O,R> MetadataBuilder applyAttributeConverter(AttributeConverter<O, R> attributeConverter) Adds an AttributeConverter instance.<O,R> MetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter<O, R>> attributeConverterClass) Adds an AttributeConverter by its Class.<O,R> MetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter<O, R>> attributeConverterClass, boolean autoApply) Adds anAttributeConverterbyClass, explicitly indicating whether to auto-apply it.applyAttributeConverter(ConverterDescriptor<?, ?> descriptor) Adds an AttributeConverter by aConverterDescriptorapplyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) Contribute anAuxiliaryDatabaseObject.applyBasicType(BasicType<?> type) Specify an additional or overridden basic type mapping.applyBasicType(BasicType<?> type, String... keys) Specify an additional or overridden basic type mapping supplying specific registration keys.applyBasicType(UserType<?> type, String... keys) Register an additional or overridden custom type mapping.applyCacheRegionDefinition(CacheRegionDefinition cacheRegionDefinition) Apply aCacheRegionDefinitionto be applied to an entity, collection, or query while building theMetadataobject.applyColumnOrderingStrategy(ColumnOrderingStrategy columnOrderingStrategy) Specify theColumnOrderingStrategy.applyFunctions(FunctionContributor functionContributor) Apply an explicitFunctionContributor(implicit application viaServiceLoaderwill still happen too)applyImplicitCatalogName(String implicitCatalogName) Specify the implicit catalog name to apply to any unqualified database names.applyImplicitListSemantics(CollectionClassification classification) applyImplicitNamingStrategy(ImplicitNamingStrategy namingStrategy) Specify theImplicitNamingStrategy.applyImplicitSchemaName(String implicitSchemaName) Specify the implicit schema name to apply to any unqualified database names.applyIndexView(Object jandexView) Allows specifying a specific Jandex index to use for reading annotation information.applyPhysicalNamingStrategy(PhysicalNamingStrategy namingStrategy) Specify thePhysicalNamingStrategy.applyScanEnvironment(ScanEnvironment scanEnvironment) Consider this temporary as discussed onScanEnvironmentapplyScanner(Scanner scanner) Specify a particular Scanner instance to use.applyScanOptions(ScanOptions scanOptions) Specify the options to be used in performing scanning.applySharedCacheMode(SharedCacheMode sharedCacheMode) Specify the second-level cache mode.applySqlFunction(String functionName, SqmFunctionDescriptor function) Contribute aSqmFunctionDescriptorto HQL.applyTempClassLoader(ClassLoader tempClassLoader) Apply aClassLoaderfor use while building theMetadata.applyTypes(TypeContributor typeContributor) Apply an explicitTypeContributor(implicit application viaServiceLoaderwill still happen too)build()Actually build the metamodelvoidcontributeAttributeConverter(Class<? extends AttributeConverter<?, ?>> converterClass) Register anAttributeConverterclass.voidcontributeType(BasicType<?> type) Deprecated.voidcontributeType(BasicType<?> type, String... keys) Deprecated.voidcontributeType(CompositeUserType<?> type) Register aCompositeUserTypeas the implicit (auto-applied) type for values of typeCompositeUserType.returnedClass().voidcontributeType(UserType<?> type, String[] keys) Deprecated.enableExplicitDiscriminatorsForJoinedSubclassSupport(boolean supported) Should we process or ignore explicitly defined discriminators in the case of joined subclasses? The legacy behavior of Hibernate was to ignore the discriminator annotations because Hibernate (unlike some providers) does not need discriminators to determine the concrete type when it comes to joined inheritance.enableGlobalNationalizedCharacterDataSupport(boolean enabled) Should nationalized variants of character data be used in the database types? For example, shouldNVARCHARbe used instead ofVARCHAR?NCLOBinstead ofCLOB?enableImplicitDiscriminatorsForJoinedSubclassSupport(boolean supported) Similarly toMetadataBuilder.enableExplicitDiscriminatorsForJoinedSubclassSupport(boolean), but here how should we treat joined inheritance when there is no explicitly defined discriminator annotations? If enabled, we will handle joined inheritance with no explicit discriminator annotations by implicitly creating one (following the JPA implicit naming rules).enableImplicitForcingOfDiscriminatorsInSelect(boolean supported) For entities which do not explicitly say, should we force discriminators into SQL selects? The (historical) default isfalse.Get the options being collected on this MetadataBuilder that will ultimately be used in building the Metadata.static StandardServiceRegistrygetStandardServiceRegistry(ServiceRegistry serviceRegistry) TheTypeConfigurationto contribute toMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.boot.model.TypeContributions
contributeJavaType, contributeJdbcType, contributeJdbcTypeConstructor, contributeType
-
Constructor Details
-
MetadataBuilderImpl
-
MetadataBuilderImpl
-
-
Method Details
-
getStandardServiceRegistry
-
applyImplicitSchemaName
Description copied from interface:MetadataBuilderSpecify the implicit schema name to apply to any unqualified database names.Its default is defined by the "hibernate.default_schema" setting if using property-based configuration.
- Specified by:
applyImplicitSchemaNamein interfaceMetadataBuilder- Parameters:
implicitSchemaName- The implicit schema name- Returns:
this, for method chaining- See Also:
-
applyImplicitCatalogName
Description copied from interface:MetadataBuilderSpecify the implicit catalog name to apply to any unqualified database names.Its default is defined by the "hibernate.default_catalog" setting if using property-based configuration.
- Specified by:
applyImplicitCatalogNamein interfaceMetadataBuilder- Parameters:
implicitCatalogName- The implicit catalog name- Returns:
this, for method chaining- See Also:
-
applyImplicitNamingStrategy
Description copied from interface:MetadataBuilderSpecify theImplicitNamingStrategy.Its default is defined by the "hibernate.implicit_naming_strategy" setting if using property-based configuration.
- Specified by:
applyImplicitNamingStrategyin interfaceMetadataBuilder- Parameters:
namingStrategy- TheImplicitNamingStrategy- Returns:
this, for method chaining- See Also:
-
applyPhysicalNamingStrategy
Description copied from interface:MetadataBuilderSpecify thePhysicalNamingStrategy.Its default is defined by the "hibernate.physical_naming_strategy" setting if using property-based configuration.
- Specified by:
applyPhysicalNamingStrategyin interfaceMetadataBuilder- Parameters:
namingStrategy- ThePhysicalNamingStrategy- Returns:
this, for method chaining- See Also:
-
applyColumnOrderingStrategy
Description copied from interface:MetadataBuilderSpecify theColumnOrderingStrategy.Its default is defined by the "hibernate.column_ordering_strategy" setting if using property-based configuration.
- Specified by:
applyColumnOrderingStrategyin interfaceMetadataBuilder- Parameters:
columnOrderingStrategy- TheColumnOrderingStrategy- Returns:
this, for method chaining- See Also:
-
applyAccessType
Description copied from interface:MetadataBuilderSpecify the second-level access-type to be used by default for entities and collections that define second-level caching, but do not specify a granular access-type.Its default is defined by the "hibernate.cache.default_cache_concurrency_strategy" setting if using property-based configuration.
- Specified by:
applyAccessTypein interfaceMetadataBuilder- Parameters:
implicitCacheAccessType- The access-type to use as default.- Returns:
this, for method chaining- See Also:
-
applyIndexView
Description copied from interface:MetadataBuilderAllows specifying a specific Jandex index to use for reading annotation information.It's important to understand that if a Jandex index is passed in, it is expected that this Jandex index already contains all entries for all classes. No additional indexing will be done in this case.
- Specified by:
applyIndexViewin interfaceMetadataBuilder- Parameters:
jandexView- The Jandex index to use.- Returns:
this, for method chaining
-
applyScanOptions
Description copied from interface:MetadataBuilderSpecify the options to be used in performing scanning.- Specified by:
applyScanOptionsin interfaceMetadataBuilder- Parameters:
scanOptions- The scan options.- Returns:
this, for method chaining- See Also:
-
applyScanEnvironment
Description copied from interface:MetadataBuilderConsider this temporary as discussed onScanEnvironment- Specified by:
applyScanEnvironmentin interfaceMetadataBuilder- Parameters:
scanEnvironment- The environment for scanning- Returns:
this, for method chaining
-
applyScanner
Description copied from interface:MetadataBuilderSpecify a particular Scanner instance to use.Its default is defined by the "hibernate.archive.scanner" setting if using property-based configuration.
- Specified by:
applyScannerin interfaceMetadataBuilder- Parameters:
scanner- The scanner to use.- Returns:
this, for method chaining- See Also:
-
applyArchiveDescriptorFactory
Description copied from interface:MetadataBuilderSpecify a particular ArchiveDescriptorFactory instance to use in scanning.Its default is defined by the "hibernate.archive.interpreter" setting if using property-based configuration.
- Specified by:
applyArchiveDescriptorFactoryin interfaceMetadataBuilder- Parameters:
factory- The ArchiveDescriptorFactory to use.- Returns:
this, for method chaining- See Also:
-
applyImplicitListSemantics
- Specified by:
applyImplicitListSemanticsin interfaceMetadataBuilder
-
enableExplicitDiscriminatorsForJoinedSubclassSupport
Description copied from interface:MetadataBuilderShould we process or ignore explicitly defined discriminators in the case of joined subclasses? The legacy behavior of Hibernate was to ignore the discriminator annotations because Hibernate (unlike some providers) does not need discriminators to determine the concrete type when it comes to joined inheritance. However, for portability reasons we do now allow using explicit discriminators along with joined inheritance. It is configurable though to support legacy apps.Its default is defined by the "hibernate.discriminator.ignore_explicit_for_joined" setting if using property-based configuration.
- Specified by:
enableExplicitDiscriminatorsForJoinedSubclassSupportin interfaceMetadataBuilder- Parameters:
supported- Should processing (not ignoring) explicit discriminators be enabled?- Returns:
this, for method chaining- See Also:
-
enableImplicitDiscriminatorsForJoinedSubclassSupport
Description copied from interface:MetadataBuilderSimilarly toMetadataBuilder.enableExplicitDiscriminatorsForJoinedSubclassSupport(boolean), but here how should we treat joined inheritance when there is no explicitly defined discriminator annotations? If enabled, we will handle joined inheritance with no explicit discriminator annotations by implicitly creating one (following the JPA implicit naming rules).Again the premise here is JPA portability, bearing in mind that some JPA provider need these discriminators.
Its default is defined by the "hibernate.discriminator.implicit_for_joined" setting if using property-based configuration.
- Specified by:
enableImplicitDiscriminatorsForJoinedSubclassSupportin interfaceMetadataBuilder- Parameters:
supported- Should we implicitly create discriminator for joined inheritance if one is not explicitly mentioned?- Returns:
this, for method chaining- See Also:
-
enableImplicitForcingOfDiscriminatorsInSelect
Description copied from interface:MetadataBuilderFor entities which do not explicitly say, should we force discriminators into SQL selects? The (historical) default isfalse.Its default is defined by the "hibernate.discriminator.force_in_select" setting if using property-based configuration.
- Specified by:
enableImplicitForcingOfDiscriminatorsInSelectin interfaceMetadataBuilder- Parameters:
supported-trueindicates we will force the discriminator into the select;falseindicates we will not.- Returns:
this, for method chaining- See Also:
-
enableGlobalNationalizedCharacterDataSupport
Description copied from interface:MetadataBuilderShould nationalized variants of character data be used in the database types? For example, shouldNVARCHARbe used instead ofVARCHAR?NCLOBinstead ofCLOB?Its default is defined by the "hibernate.use_nationalized_character_data" setting if using property-based configuration.
- Specified by:
enableGlobalNationalizedCharacterDataSupportin interfaceMetadataBuilder- Parameters:
enabled-truesays to use nationalized variants;falsesays to use the non-nationalized variants.- Returns:
this, for method chaining- See Also:
-
applyBasicType
Description copied from interface:MetadataBuilderSpecify an additional or overridden basic type mapping.- Specified by:
applyBasicTypein interfaceMetadataBuilder- Parameters:
type- The type addition or override.- Returns:
this, for method chaining
-
applyBasicType
Description copied from interface:MetadataBuilderSpecify an additional or overridden basic type mapping supplying specific registration keys.- Specified by:
applyBasicTypein interfaceMetadataBuilder- Parameters:
type- The type addition or override.keys- The keys under which to register the basic type.- Returns:
this, for method chaining
-
applyBasicType
Description copied from interface:MetadataBuilderRegister an additional or overridden custom type mapping.- Specified by:
applyBasicTypein interfaceMetadataBuilder- Parameters:
type- The custom typekeys- The keys under which to register the custom type.- Returns:
this, for method chaining
-
applyTypes
Description copied from interface:MetadataBuilderApply an explicitTypeContributor(implicit application viaServiceLoaderwill still happen too)- Specified by:
applyTypesin interfaceMetadataBuilder- Parameters:
typeContributor- The contributor to apply- Returns:
this, for method chaining
-
contributeType
Deprecated.- Specified by:
contributeTypein interfaceTypeContributions
-
contributeType
Deprecated.- Specified by:
contributeTypein interfaceTypeContributions
-
contributeType
Deprecated.- Specified by:
contributeTypein interfaceTypeContributions
-
contributeType
Description copied from interface:TypeContributionsRegister aCompositeUserTypeas the implicit (auto-applied) type for values of typeCompositeUserType.returnedClass().- Specified by:
contributeTypein interfaceTypeContributions
-
getTypeConfiguration
Description copied from interface:TypeContributionsTheTypeConfigurationto contribute to- Specified by:
getTypeConfigurationin interfaceTypeContributions
-
contributeAttributeConverter
Description copied from interface:TypeContributionsRegister anAttributeConverterclass.- Specified by:
contributeAttributeConverterin interfaceTypeContributions
-
applyCacheRegionDefinition
Description copied from interface:MetadataBuilderApply aCacheRegionDefinitionto be applied to an entity, collection, or query while building theMetadataobject.- Specified by:
applyCacheRegionDefinitionin interfaceMetadataBuilder- Parameters:
cacheRegionDefinition- The cache region definition to apply- Returns:
this, for method chaining
-
applyTempClassLoader
Description copied from interface:MetadataBuilderApply aClassLoaderfor use while building theMetadata.Ideally we should avoid accessing
ClassLoaders when perform 1st phase of bootstrap. This is aClassLoaderthat can be used in cases where we absolutely must.In EE managed environments, this is the
ClassLoadermandated byPersistenceUnitInfo.getNewTempClassLoader(). ThisClassLoaderis discarded by the container afterward, the idea being that theClasscan still be enhanced in the applicationClassLoader.In other environments, pass a
ClassLoaderthat performs the same function, if desired.- Specified by:
applyTempClassLoaderin interfaceMetadataBuilder- Parameters:
tempClassLoader-ClassLoaderfor use while building theMetadata- Returns:
this, for method chaining
-
noConstraintByDefault
-
applyFunctions
Description copied from interface:MetadataBuilderApply an explicitFunctionContributor(implicit application viaServiceLoaderwill still happen too)- Specified by:
applyFunctionsin interfaceMetadataBuilder- Parameters:
functionContributor- The contributor to apply- Returns:
this, for method chaining
-
applySqlFunction
Description copied from interface:MetadataBuilderContribute aSqmFunctionDescriptorto HQL.- Specified by:
applySqlFunctionin interfaceMetadataBuilder- See Also:
-
applyAuxiliaryDatabaseObject
public MetadataBuilder applyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) Description copied from interface:MetadataBuilderContribute anAuxiliaryDatabaseObject.- Specified by:
applyAuxiliaryDatabaseObjectin interfaceMetadataBuilder
-
applyAttributeConverter
Description copied from interface:MetadataBuilderAdds an AttributeConverter by aConverterDescriptor- Specified by:
applyAttributeConverterin interfaceMetadataBuilder- Parameters:
descriptor- The descriptor- Returns:
thisfor method chaining
-
applyAttributeConverter
public <O,R> MetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter<O, R>> attributeConverterClass) Description copied from interface:MetadataBuilderAdds an AttributeConverter by its Class.- Specified by:
applyAttributeConverterin interfaceMetadataBuilder- Parameters:
attributeConverterClass- The AttributeConverter class.- Returns:
thisfor method chaining
-
applyAttributeConverter
public <O,R> MetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter<O, R>> attributeConverterClass, boolean autoApply) Description copied from interface:MetadataBuilderAdds anAttributeConverterbyClass, explicitly indicating whether to auto-apply it.- Specified by:
applyAttributeConverterin interfaceMetadataBuilder- Parameters:
attributeConverterClass- The AttributeConverter class.autoApply- Should the AttributeConverter be auto applied to property types as specified by its "entity attribute" parameterized type?- Returns:
thisfor method chaining
-
applyAttributeConverter
Description copied from interface:MetadataBuilderAdds an AttributeConverter instance.- Specified by:
applyAttributeConverterin interfaceMetadataBuilder- Parameters:
attributeConverter- The AttributeConverter instance.- Returns:
thisfor method chaining
-
applyAttributeConverter
public MetadataBuilder applyAttributeConverter(AttributeConverter<?, ?> attributeConverter, boolean autoApply) Description copied from interface:MetadataBuilderAdds anAttributeConverterinstance, explicitly indicating whether to auto-apply it.- Specified by:
applyAttributeConverterin interfaceMetadataBuilder- Parameters:
attributeConverter- The AttributeConverter instance.autoApply- Should the AttributeConverter be auto applied to property types as specified by its "entity attribute" parameterized type?- Returns:
thisfor method chaining
-
build
Description copied from interface:MetadataBuilderActually build the metamodel- Specified by:
buildin interfaceMetadataBuilder- Returns:
- The built metadata.
-
getBootstrapContext
- Specified by:
getBootstrapContextin interfaceMetadataBuilderImplementor
-
getMetadataBuildingOptions
Description copied from interface:MetadataBuilderImplementorGet the options being collected on this MetadataBuilder that will ultimately be used in building the Metadata.- Specified by:
getMetadataBuildingOptionsin interfaceMetadataBuilderImplementor- Returns:
- The current building options
-