public class MetadataBuilderImpl extends Object implements MetadataBuilderImplementor, TypeContributions
Modifier and Type | Class and Description |
---|---|
static class |
MetadataBuilderImpl.MappingDefaultsImpl |
static class |
MetadataBuilderImpl.MetadataBuildingOptionsImpl |
Constructor and Description |
---|
MetadataBuilderImpl(MetadataSources sources) |
MetadataBuilderImpl(MetadataSources sources,
StandardServiceRegistry serviceRegistry) |
Modifier and Type | Method and Description |
---|---|
MetadataBuilder |
allowSpecjSyntax() |
MetadataBuilder |
applyAccessType(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.
|
MetadataBuilder |
applyArchiveDescriptorFactory(ArchiveDescriptorFactory factory)
Specify a particular ArchiveDescriptorFactory instance to use in scanning.
|
MetadataBuilder |
applyAttributeConverter(AttributeConverter attributeConverter)
Adds an AttributeConverter instance.
|
MetadataBuilder |
applyAttributeConverter(AttributeConverter attributeConverter,
boolean autoApply)
Adds an AttributeConverter instance, explicitly indicating whether to auto-apply.
|
MetadataBuilder |
applyAttributeConverter(AttributeConverterDefinition definition)
Adds an AttributeConverter by a AttributeConverterDefinition
|
MetadataBuilder |
applyAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass)
Adds an AttributeConverter by its Class.
|
MetadataBuilder |
applyAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass,
boolean autoApply)
Adds an AttributeConverter by its Class plus a boolean indicating whether to auto apply it.
|
MetadataBuilder |
applyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) |
MetadataBuilder |
applyBasicType(BasicType type)
Specify an additional or overridden basic type mapping.
|
MetadataBuilder |
applyBasicType(BasicType type,
String... keys)
Specify an additional or overridden basic type mapping supplying specific
registration keys.
|
MetadataBuilder |
applyBasicType(CompositeUserType type,
String... keys)
Register an additional or overridden composite custom type mapping.
|
MetadataBuilder |
applyBasicType(UserType type,
String... keys)
Register an additional or overridden custom type mapping.
|
MetadataBuilder |
applyCacheRegionDefinition(CacheRegionDefinition cacheRegionDefinition)
Apply a CacheRegionDefinition to be applied to an entity, collection or query while building the
Metadata object.
|
MetadataBuilder |
applyIdGenerationTypeInterpreter(IdGeneratorStrategyInterpreter interpreter) |
MetadataBuilder |
applyImplicitCatalogName(String implicitCatalogName)
Specify the implicit catalog name to apply to any unqualified database names.
|
MetadataBuilder |
applyImplicitNamingStrategy(ImplicitNamingStrategy namingStrategy)
Specify the ImplicitNamingStrategy to use in building the Metadata.
|
MetadataBuilder |
applyImplicitSchemaName(String implicitSchemaName)
Specify the implicit schema name to apply to any unqualified database names.
|
MetadataBuilder |
applyIndexView(org.jboss.jandex.IndexView jandexView)
Allows specifying a specific Jandex index to use for reading annotation information.
|
MetadataBuilder |
applyPhysicalNamingStrategy(PhysicalNamingStrategy namingStrategy)
Specify the PhysicalNamingStrategy to use in building the Metadata.
|
MetadataBuilder |
applyReflectionManager(org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager)
Defines the Hibernate Commons Annotations ReflectionManager to use
|
MetadataBuilder |
applyScanEnvironment(ScanEnvironment scanEnvironment)
Consider this temporary as discussed on
ScanEnvironment |
MetadataBuilder |
applyScanner(Scanner scanner)
Specify a particular Scanner instance to use.
|
MetadataBuilder |
applyScanOptions(ScanOptions scanOptions)
Specify the options to be used in performing scanning.
|
MetadataBuilder |
applySharedCacheMode(SharedCacheMode sharedCacheMode)
Specify the second-level cache mode to be used.
|
MetadataBuilder |
applySourceProcessOrdering(MetadataSourceType... sourceTypes)
Apply a specific ordering to the processing of sources.
|
MetadataBuilder |
applySqlFunction(String functionName,
SQLFunction function) |
MetadataBuilder |
applyTempClassLoader(ClassLoader tempClassLoader)
Apply a ClassLoader for use while building the Metadata.
|
MetadataBuilder |
applyTypes(TypeContributor typeContributor)
Apply an explicit TypeContributor (implicit application via ServiceLoader will still happen too)
|
MetadataImplementor |
build()
Actually build the metamodel
|
void |
contributeType(BasicType type) |
void |
contributeType(BasicType type,
String... keys) |
void |
contributeType(CompositeUserType type,
String[] keys) |
void |
contributeType(UserType type,
String[] keys) |
MetadataBuilder |
enableExplicitDiscriminatorsForJoinedSubclassSupport(boolean supported)
Should we process or ignore explicitly defined discriminators in the case
of joined-subclasses.
|
MetadataBuilder |
enableGlobalNationalizedCharacterDataSupport(boolean enabled)
Should nationalized variants of character data be used in the database types? For example, should
NVARCHAR be used instead of VARCHAR ? NCLOB instead of CLOB ?
Its default is defined by the AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA
setting if using property-based configuration. |
MetadataBuilder |
enableImplicitDiscriminatorsForJoinedSubclassSupport(boolean supported)
Similarly to
MetadataBuilder.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). |
MetadataBuilder |
enableImplicitForcingOfDiscriminatorsInSelect(boolean supported)
For entities which do not explicitly say, should we force discriminators into
SQL selects? The (historical) default is
false
Its default is defined by the AvailableSettings.FORCE_DISCRIMINATOR_IN_SELECTS_BY_DEFAULT
setting if using property-based configuration. |
MetadataBuilder |
enableNewIdentifierGeneratorSupport(boolean enabled)
Should we enable support for the "new" (since 3.2) identifier generator mappings for
handling:
GenerationType.SEQUENCE
GenerationType.IDENTITY
GenerationType.TABLE
GenerationType.AUTO
Its default is defined by the AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS
setting if using property-based configuration. |
MetadataBuildingOptions |
getMetadataBuildingOptions()
Get the options being collected on this MetadataBuilder that will ultimately be used in
building the Metadata.
|
<T extends MetadataBuilder> |
unwrap(Class<T> type)
Allows unwrapping this builder as another, more specific type.
|
public MetadataBuilderImpl(MetadataSources sources)
public MetadataBuilderImpl(MetadataSources sources, StandardServiceRegistry serviceRegistry)
public MetadataBuilder applyImplicitSchemaName(String implicitSchemaName)
MetadataBuilder
AvailableSettings.DEFAULT_SCHEMA
setting if using property-based configuration.applyImplicitSchemaName
in interface MetadataBuilder
implicitSchemaName
- The implicit schema namethis
, for method chainingAvailableSettings.DEFAULT_SCHEMA
public MetadataBuilder applyImplicitCatalogName(String implicitCatalogName)
MetadataBuilder
AvailableSettings.DEFAULT_CATALOG
setting if using property-based configuration.applyImplicitCatalogName
in interface MetadataBuilder
implicitCatalogName
- The implicit catalog namethis
, for method chainingAvailableSettings.DEFAULT_CATALOG
public MetadataBuilder applyImplicitNamingStrategy(ImplicitNamingStrategy namingStrategy)
MetadataBuilder
AvailableSettings.IMPLICIT_NAMING_STRATEGY
setting if using property-based configuration.applyImplicitNamingStrategy
in interface MetadataBuilder
namingStrategy
- The ImplicitNamingStrategy to applythis
, for method chainingAvailableSettings.IMPLICIT_NAMING_STRATEGY
public MetadataBuilder applyPhysicalNamingStrategy(PhysicalNamingStrategy namingStrategy)
MetadataBuilder
AvailableSettings.PHYSICAL_NAMING_STRATEGY
setting if using property-based configuration.applyPhysicalNamingStrategy
in interface MetadataBuilder
namingStrategy
- The PhysicalNamingStrategy to applythis
, for method chainingAvailableSettings.PHYSICAL_NAMING_STRATEGY
public MetadataBuilder applyReflectionManager(org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager)
MetadataBuilder
applyReflectionManager
in interface MetadataBuilder
reflectionManager
- The ReflectionManager to use.this
, for method chainingpublic MetadataBuilder applySharedCacheMode(SharedCacheMode sharedCacheMode)
MetadataBuilder
applySharedCacheMode
in interface MetadataBuilder
sharedCacheMode
- The cache mode.this
, for method chainingMetadataBuilder.applyAccessType(org.hibernate.cache.spi.access.AccessType)
public MetadataBuilder applyAccessType(AccessType implicitCacheAccessType)
MetadataBuilder
AvailableSettings.DEFAULT_CACHE_CONCURRENCY_STRATEGY
setting if using property-based configuration.applyAccessType
in interface MetadataBuilder
implicitCacheAccessType
- The access-type to use as default.this
, for method chainingAvailableSettings.DEFAULT_CACHE_CONCURRENCY_STRATEGY
,
MetadataBuilder.applySharedCacheMode(javax.persistence.SharedCacheMode)
public MetadataBuilder applyIndexView(org.jboss.jandex.IndexView jandexView)
MetadataBuilder
applyIndexView
in interface MetadataBuilder
jandexView
- The Jandex index to use.this
, for method chainingpublic MetadataBuilder applyScanOptions(ScanOptions scanOptions)
MetadataBuilder
applyScanOptions
in interface MetadataBuilder
scanOptions
- The scan options.this
, for method chainingAvailableSettings.SCANNER_DISCOVERY
public MetadataBuilder applyScanEnvironment(ScanEnvironment scanEnvironment)
MetadataBuilder
ScanEnvironment
applyScanEnvironment
in interface MetadataBuilder
scanEnvironment
- The environment for scanningthis
, for method chainingpublic MetadataBuilder applyScanner(Scanner scanner)
MetadataBuilder
AvailableSettings.SCANNER
setting if using property-based configuration.applyScanner
in interface MetadataBuilder
scanner
- The scanner to use.this
, for method chainingAvailableSettings.SCANNER
public MetadataBuilder applyArchiveDescriptorFactory(ArchiveDescriptorFactory factory)
MetadataBuilder
AvailableSettings.SCANNER_ARCHIVE_INTERPRETER
setting if using property-based configuration.applyArchiveDescriptorFactory
in interface MetadataBuilder
factory
- The ArchiveDescriptorFactory to use.this
, for method chainingAvailableSettings.SCANNER_ARCHIVE_INTERPRETER
public MetadataBuilder enableExplicitDiscriminatorsForJoinedSubclassSupport(boolean supported)
MetadataBuilder
AvailableSettings.IGNORE_EXPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS
setting if using property-based configuration.enableExplicitDiscriminatorsForJoinedSubclassSupport
in interface MetadataBuilder
supported
- Should processing (not ignoring) explicit discriminators be
enabled?this
, for method chainingAvailableSettings.IGNORE_EXPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS
public MetadataBuilder enableImplicitDiscriminatorsForJoinedSubclassSupport(boolean supported)
MetadataBuilder
MetadataBuilder.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 AvailableSettings.IMPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS
setting if using property-based configuration.enableImplicitDiscriminatorsForJoinedSubclassSupport
in interface MetadataBuilder
supported
- Should we implicitly create discriminator for joined
inheritance if one is not explicitly mentioned?this
, for method chainingAvailableSettings.IMPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS
public MetadataBuilder enableImplicitForcingOfDiscriminatorsInSelect(boolean supported)
MetadataBuilder
false
Its default is defined by the AvailableSettings.FORCE_DISCRIMINATOR_IN_SELECTS_BY_DEFAULT
setting if using property-based configuration.enableImplicitForcingOfDiscriminatorsInSelect
in interface MetadataBuilder
supported
- true
indicates we will force the discriminator into the select;
false
indicates we will not.this
, for method chainingAvailableSettings.FORCE_DISCRIMINATOR_IN_SELECTS_BY_DEFAULT
public MetadataBuilder enableGlobalNationalizedCharacterDataSupport(boolean enabled)
MetadataBuilder
NVARCHAR
be used instead of VARCHAR
? NCLOB
instead of CLOB
?
Its default is defined by the AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA
setting if using property-based configuration.enableGlobalNationalizedCharacterDataSupport
in interface MetadataBuilder
enabled
- true
says to use nationalized variants; false
says to use the non-nationalized variants.this
, for method chainingAvailableSettings.USE_NATIONALIZED_CHARACTER_DATA
public MetadataBuilder applyBasicType(BasicType type)
MetadataBuilder
applyBasicType
in interface MetadataBuilder
type
- The type addition or override.this
, for method chainingpublic MetadataBuilder applyBasicType(BasicType type, String... keys)
MetadataBuilder
applyBasicType
in interface MetadataBuilder
type
- The type addition or override.keys
- The keys under which to register the basic type.this
, for method chainingpublic MetadataBuilder applyBasicType(UserType type, String... keys)
MetadataBuilder
applyBasicType
in interface MetadataBuilder
type
- The custom typekeys
- The keys under which to register the custom type.this
, for method chainingpublic MetadataBuilder applyBasicType(CompositeUserType type, String... keys)
MetadataBuilder
applyBasicType
in interface MetadataBuilder
type
- The composite custom typekeys
- The keys under which to register the composite custom type.this
, for method chainingpublic MetadataBuilder applyTypes(TypeContributor typeContributor)
MetadataBuilder
applyTypes
in interface MetadataBuilder
typeContributor
- The contributor to applythis
, for method chainingpublic void contributeType(BasicType type)
contributeType
in interface TypeContributions
public void contributeType(BasicType type, String... keys)
contributeType
in interface TypeContributions
public void contributeType(UserType type, String[] keys)
contributeType
in interface TypeContributions
public void contributeType(CompositeUserType type, String[] keys)
contributeType
in interface TypeContributions
public MetadataBuilder applyCacheRegionDefinition(CacheRegionDefinition cacheRegionDefinition)
MetadataBuilder
applyCacheRegionDefinition
in interface MetadataBuilder
cacheRegionDefinition
- The cache region definition to applythis
, for method chainingpublic MetadataBuilder applyTempClassLoader(ClassLoader tempClassLoader)
MetadataBuilder
PersistenceUnitInfo.getNewTempClassLoader()
. This ClassLoader
is thrown away by the container afterwards. The idea being that the Class can still be enhanced
in the application ClassLoader. In other environments, pass a ClassLoader that performs the
same function if desired.applyTempClassLoader
in interface MetadataBuilder
tempClassLoader
- ClassLoader for use during building the Metadatathis
, for method chainingpublic MetadataBuilder applySourceProcessOrdering(MetadataSourceType... sourceTypes)
MetadataBuilder
AvailableSettings.ARTIFACT_PROCESSING_ORDER
setting if using property-based configuration.applySourceProcessOrdering
in interface MetadataBuilder
sourceTypes
- The types, in the order they should be processedthis
for method chainingAvailableSettings.ARTIFACT_PROCESSING_ORDER
public MetadataBuilder allowSpecjSyntax()
public MetadataBuilder applySqlFunction(String functionName, SQLFunction function)
applySqlFunction
in interface MetadataBuilder
public MetadataBuilder applyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
applyAuxiliaryDatabaseObject
in interface MetadataBuilder
public MetadataBuilder applyAttributeConverter(AttributeConverterDefinition definition)
MetadataBuilder
applyAttributeConverter
in interface MetadataBuilder
definition
- The definitionthis
for method chainingpublic MetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass)
MetadataBuilder
applyAttributeConverter
in interface MetadataBuilder
attributeConverterClass
- The AttributeConverter class.this
for method chainingAttributeConverterDefinition.from(Class)
public MetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass, boolean autoApply)
MetadataBuilder
applyAttributeConverter
in interface MetadataBuilder
attributeConverterClass
- The AttributeConverter class.autoApply
- Should the AttributeConverter be auto applied to property types as specified
by its "entity attribute" parameterized type?this
for method chainingAttributeConverterDefinition.from(Class, boolean)
public MetadataBuilder applyAttributeConverter(AttributeConverter attributeConverter)
MetadataBuilder
applyAttributeConverter
in interface MetadataBuilder
attributeConverter
- The AttributeConverter instance.this
for method chainingAttributeConverterDefinition.from(AttributeConverter)
public MetadataBuilder applyAttributeConverter(AttributeConverter attributeConverter, boolean autoApply)
MetadataBuilder
applyAttributeConverter
in interface MetadataBuilder
attributeConverter
- The AttributeConverter instance.autoApply
- Should the AttributeConverter be auto applied to property types as specified
by its "entity attribute" parameterized type?this
for method chainingAttributeConverterDefinition.from(AttributeConverter, boolean)
public MetadataBuilder enableNewIdentifierGeneratorSupport(boolean enabled)
MetadataBuilder
AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS
setting if using property-based configuration.enableNewIdentifierGeneratorSupport
in interface MetadataBuilder
enabled
- true
to enable; false
to disable;don't call for
default.this
, for method chainingAvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS
public MetadataBuilder applyIdGenerationTypeInterpreter(IdGeneratorStrategyInterpreter interpreter)
applyIdGenerationTypeInterpreter
in interface MetadataBuilder
public <T extends MetadataBuilder> T unwrap(Class<T> type)
MetadataBuilder
unwrap
in interface MetadataBuilder
public MetadataImplementor build()
MetadataBuilder
build
in interface MetadataBuilder
public MetadataBuildingOptions getMetadataBuildingOptions()
MetadataBuilderImplementor
getMetadataBuildingOptions
in interface MetadataBuilderImplementor
Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.