public interface MetadataBuilder
Contract for specifying various overrides to be used in metamodel building.
Modifier and Type | Method and Description |
---|---|
MetadataBuilder |
applyAccessType(AccessType accessType)
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)
Deprecated.
(since 5.3) AttributeConverterDefinition forces early
access to the AttributeConverter instance which precludes the
possibility to resolve the converter from CDI, etc. Instead use
one of:
|
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 |
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 cacheMode)
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)
|
Metadata |
build()
Actually build the metamodel
|
MetadataBuilder |
enableExplicitDiscriminatorsForJoinedSubclassSupport(boolean enabled)
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 ?
<p/>
Its default is defined by the AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA
setting if using property-based configuration. |
MetadataBuilder |
enableImplicitDiscriminatorsForJoinedSubclassSupport(boolean enabled)
Similarly to
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
<p/>
Its default is defined by the AvailableSettings.FORCE_DISCRIMINATOR_IN_SELECTS_BY_DEFAULT
setting if using property-based configuration. |
MetadataBuilder |
enableNewIdentifierGeneratorSupport(boolean enable)
Should we enable support for the "new" (since 3.2) identifier generator mappings for
handling:<ul>
<li>
GenerationType.SEQUENCE </li>
<li>GenerationType.IDENTITY </li>
<li>GenerationType.TABLE </li>
<li>GenerationType.AUTO </li>
</ul>
<p/>
Its default is defined by the AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS
setting if using property-based configuration. |
<T extends MetadataBuilder> |
unwrap(Class<T> type)
Allows unwrapping this builder as another, more specific type.
|
MetadataBuilder applyImplicitCatalogName(String implicitCatalogName)
Specify the implicit catalog name to apply to any unqualified database names.
<p/>
Its default is defined by the AvailableSettings.DEFAULT_CATALOG
setting if using property-based configuration.
implicitCatalogName
- The implicit catalog namethis
, for method chainingAvailableSettings.DEFAULT_CATALOG
MetadataBuilder applyImplicitSchemaName(String implicitSchemaName)
Specify the implicit schema name to apply to any unqualified database names.
<p/>
Its default is defined by the AvailableSettings.DEFAULT_SCHEMA
setting if using property-based configuration.
implicitSchemaName
- The implicit schema namethis
, for method chainingAvailableSettings.DEFAULT_SCHEMA
MetadataBuilder applyImplicitNamingStrategy(ImplicitNamingStrategy namingStrategy)
Specify the ImplicitNamingStrategy to use in building the Metadata.
<p/>
Its default is defined by the AvailableSettings.IMPLICIT_NAMING_STRATEGY
setting if using property-based configuration.
namingStrategy
- The ImplicitNamingStrategy to applythis
, for method chainingAvailableSettings.IMPLICIT_NAMING_STRATEGY
MetadataBuilder applyPhysicalNamingStrategy(PhysicalNamingStrategy namingStrategy)
Specify the PhysicalNamingStrategy to use in building the Metadata.
<p/>
Its default is defined by the AvailableSettings.PHYSICAL_NAMING_STRATEGY
setting if using property-based configuration.
namingStrategy
- The PhysicalNamingStrategy to applythis
, for method chainingAvailableSettings.PHYSICAL_NAMING_STRATEGY
MetadataBuilder applySharedCacheMode(SharedCacheMode cacheMode)
Specify the second-level cache mode to be used. This is the cache mode in terms of whether or not to cache. <p/> Its default is defined by the setting if using property-based configuration.
cacheMode
- The cache mode.this
, for method chainingapplyAccessType(org.hibernate.cache.spi.access.AccessType)
MetadataBuilder applyAccessType(AccessType accessType)
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.
<p/>
Its default is defined by the AvailableSettings.DEFAULT_CACHE_CONCURRENCY_STRATEGY
setting if using property-based configuration.
accessType
- The access-type to use as default.this
, for method chainingAvailableSettings.DEFAULT_CACHE_CONCURRENCY_STRATEGY
,
applySharedCacheMode(javax.persistence.SharedCacheMode)
MetadataBuilder applyIndexView(org.jboss.jandex.IndexView jandexView)
Allows specifying a specific Jandex index to use for reading annotation information. <p/> It is <i>important</i> 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. <p/> NOTE : Here for future expansion. At the moment the passed Jandex index is not used.
jandexView
- The Jandex index to use.this
, for method chainingMetadataBuilder applyScanOptions(ScanOptions scanOptions)
Specify the options to be used in performing scanning.
scanOptions
- The scan options.this
, for method chainingAvailableSettings.SCANNER_DISCOVERY
MetadataBuilder applyScanEnvironment(ScanEnvironment scanEnvironment)
Consider this temporary as discussed on ScanEnvironment
scanEnvironment
- The environment for scanningthis
, for method chainingMetadataBuilder applyScanner(Scanner scanner)
Specify a particular Scanner instance to use.
<p/>
Its default is defined by the AvailableSettings.SCANNER
setting if using property-based configuration.
scanner
- The scanner to use.this
, for method chainingAvailableSettings.SCANNER
MetadataBuilder applyArchiveDescriptorFactory(ArchiveDescriptorFactory factory)
Specify a particular ArchiveDescriptorFactory instance to use in scanning.
<p/>
Its default is defined by the AvailableSettings.SCANNER_ARCHIVE_INTERPRETER
setting if using property-based configuration.
factory
- The ArchiveDescriptorFactory to use.this
, for method chainingAvailableSettings.SCANNER_ARCHIVE_INTERPRETER
MetadataBuilder enableNewIdentifierGeneratorSupport(boolean enable)
Should we enable support for the "new" (since 3.2) identifier generator mappings for
handling:<ul>
<li>GenerationType.SEQUENCE
</li>
<li>GenerationType.IDENTITY
</li>
<li>GenerationType.TABLE
</li>
<li>GenerationType.AUTO
</li>
</ul>
<p/>
Its default is defined by the AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS
setting if using property-based configuration.
enable
- true
to enable; false
to disable;don’t call for
default.this
, for method chainingAvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS
MetadataBuilder enableExplicitDiscriminatorsForJoinedSubclassSupport(boolean enabled)
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. However, for portability reasons we do now allow using
explicit discriminators along with joined inheritance. It is configurable
though to support legacy apps.
<p/>
Its default is defined by the AvailableSettings.IGNORE_EXPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS
setting if using property-based configuration.
enabled
- Should processing (not ignoring) explicit discriminators be
enabled?this
, for method chainingAvailableSettings.IGNORE_EXPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS
MetadataBuilder enableImplicitDiscriminatorsForJoinedSubclassSupport(boolean enabled)
Similarly to 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).
<p/>
Again the premise here is JPA portability, bearing in mind that some
JPA provider need these discriminators.
<p/>
Its default is defined by the AvailableSettings.IMPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS
setting if using property-based configuration.
enabled
- Should we implicitly create discriminator for joined
inheritance if one is not explicitly mentioned?this
, for method chainingAvailableSettings.IMPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS
MetadataBuilder enableImplicitForcingOfDiscriminatorsInSelect(boolean supported)
For entities which do not explicitly say, should we force discriminators into
SQL selects? The (historical) default is false
<p/>
Its default is defined by the AvailableSettings.FORCE_DISCRIMINATOR_IN_SELECTS_BY_DEFAULT
setting if using property-based configuration.
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
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
?
<p/>
Its default is defined by the AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA
setting if using property-based configuration.
enabled
- true
says to use nationalized variants; false
says to use the non-nationalized variants.this
, for method chainingAvailableSettings.USE_NATIONALIZED_CHARACTER_DATA
MetadataBuilder applyBasicType(BasicType type)
Specify an additional or overridden basic type mapping.
type
- The type addition or override.this
, for method chainingMetadataBuilder applyBasicType(BasicType type, String... keys)
Specify an additional or overridden basic type mapping supplying specific registration keys.
type
- The type addition or override.keys
- The keys under which to register the basic type.this
, for method chainingMetadataBuilder applyBasicType(UserType type, String... keys)
Register an additional or overridden custom type mapping.
type
- The custom typekeys
- The keys under which to register the custom type.this
, for method chainingMetadataBuilder applyBasicType(CompositeUserType type, String... keys)
Register an additional or overridden composite custom type mapping.
type
- The composite custom typekeys
- The keys under which to register the composite custom type.this
, for method chainingMetadataBuilder applyTypes(TypeContributor typeContributor)
Apply an explicit TypeContributor (implicit application via ServiceLoader will still happen too)
typeContributor
- The contributor to applythis
, for method chainingMetadataBuilder applyCacheRegionDefinition(CacheRegionDefinition cacheRegionDefinition)
Apply a CacheRegionDefinition to be applied to an entity, collection or query while building the Metadata object.
cacheRegionDefinition
- The cache region definition to applythis
, for method chainingMetadataBuilder applyTempClassLoader(ClassLoader tempClassLoader)
Apply a ClassLoader for use while building the Metadata.
<p/>
Ideally we should avoid accessing ClassLoaders when perform 1st phase of bootstrap. This
is a ClassLoader that can be used in cases when we have to. IN EE managed environments, this
is the ClassLoader mandated by
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.
tempClassLoader
- ClassLoader for use during building the Metadatathis
, for method chainingMetadataBuilder applySourceProcessOrdering(MetadataSourceType... sourceTypes)
Apply a specific ordering to the processing of sources. Note that unlike most
of the methods on this contract that deal with multiple values internally, this
one replaces any already set (its more a setter) instead of adding to.
<p/>
Its default is defined by the AvailableSettings.ARTIFACT_PROCESSING_ORDER
setting if using property-based configuration.
sourceTypes
- The types, in the order they should be processedthis
for method chainingAvailableSettings.ARTIFACT_PROCESSING_ORDER
MetadataBuilder applySqlFunction(String functionName, SQLFunction function)
MetadataBuilder applyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
@Deprecated MetadataBuilder applyAttributeConverter(AttributeConverterDefinition definition)
Adds an AttributeConverter by a AttributeConverterDefinition
definition
- The definitionthis
for method chainingMetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass)
Adds an AttributeConverter by its Class.
attributeConverterClass
- The AttributeConverter class.this
for method chainingMetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass, boolean autoApply)
Adds an AttributeConverter by its Class plus a boolean indicating whether to auto apply it.
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)
MetadataBuilder applyAttributeConverter(AttributeConverter attributeConverter)
Adds an AttributeConverter instance.
attributeConverter
- The AttributeConverter instance.this
for method chainingAttributeConverterDefinition.from(AttributeConverter)
MetadataBuilder applyAttributeConverter(AttributeConverter attributeConverter, boolean autoApply)
Adds an AttributeConverter instance, explicitly indicating whether to auto-apply.
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)
MetadataBuilder applyIdGenerationTypeInterpreter(IdGeneratorStrategyInterpreter interpreter)
<T extends MetadataBuilder> T unwrap(Class<T> type)
Allows unwrapping this builder as another, more specific type.
T
- type
- Metadata build()
Actually build the metamodel
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.