org.hibernate.metamodel.source.internal
Class MetadataImpl

java.lang.Object
  extended by org.hibernate.metamodel.source.internal.MetadataImpl
All Implemented Interfaces:
Serializable, Mapping, Metadata, BindingContext, MetadataImplementor

public class MetadataImpl
extends Object
implements MetadataImplementor, Serializable

Container for configuration data collected during binding the metamodel.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hibernate.metamodel.Metadata
Metadata.Options
 
Constructor Summary
MetadataImpl(MetadataSources metadataSources, Metadata.Options options)
           
 
Method Summary
 void addCollection(PluralAttributeBinding pluralAttributeBinding)
           
 void addEntity(EntityBinding entityBinding)
           
 void addFetchProfile(FetchProfile profile)
           
 void addFilterDefinition(FilterDefinition def)
           
 void addIdGenerator(IdGenerator generator)
           
 void addImport(String importName, String entityName)
           
 void addNamedNativeQuery(NamedSQLQueryDefinition def)
           
 void addNamedQuery(NamedQueryDefinition def)
           
 void addResultSetMapping(ResultSetMappingDefinition resultSetMappingDefinition)
           
 void addTypeDefinition(TypeDef typeDef)
           
 SessionFactory buildSessionFactory()
           
 PluralAttributeBinding getCollection(String collectionRole)
           
 Iterable<PluralAttributeBinding> getCollectionBindings()
           
 Database getDatabase()
           
 EntityBinding getEntityBinding(String entityName)
           
 Iterable<EntityBinding> getEntityBindings()
           
 Iterable<FetchProfile> getFetchProfiles()
           
 Iterable<FilterDefinition> getFilterDefinitions()
           
 MetaAttributeContext getGlobalMetaAttributeContext()
           
 IdentifierGeneratorFactory getIdentifierGeneratorFactory()
          Allow access to the id generator factory, though this is only needed/allowed from configuration.
 String getIdentifierPropertyName(String entityName)
           
 Type getIdentifierType(String entityName)
           
 IdGenerator getIdGenerator(String name)
           
 Iterable<Map.Entry<String,String>> getImports()
           
 MappingDefaults getMappingDefaults()
           
 MetadataImplementor getMetadataImplementor()
           
 NamedSQLQueryDefinition getNamedNativeQuery(String name)
           
 Iterable<NamedSQLQueryDefinition> getNamedNativeQueryDefinitions()
           
 NamedQueryDefinition getNamedQuery(String name)
           
 Iterable<NamedQueryDefinition> getNamedQueryDefinitions()
           
 NamingStrategy getNamingStrategy()
           
 Metadata.Options getOptions()
           
 Type getReferencedPropertyType(String entityName, String propertyName)
           
 Iterable<ResultSetMappingDefinition> getResultSetMappingDefinitions()
           
 EntityBinding getRootEntityBinding(String entityName)
          Get the "root" entity binding
 ServiceRegistry getServiceRegistry()
           
 SessionFactoryBuilder getSessionFactoryBuilder()
           
 TypeDef getTypeDefinition(String name)
           
 Iterable<TypeDef> getTypeDefinitions()
           
 TypeResolver getTypeResolver()
           
 boolean isGloballyQuotedIdentifiers()
           
<T> Class<T>
locateClassByName(String name)
           
 Value<Class<?>> makeClassReference(String className)
           
 Type makeJavaType(String className)
           
 String qualifyClassName(String name)
           
 void registerIdentifierGenerator(String name, String generatorClassName)
           
 void setGloballyQuotedIdentifiers(boolean globallyQuotedIdentifiers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataImpl

public MetadataImpl(MetadataSources metadataSources,
                    Metadata.Options options)
Method Detail

addFetchProfile

public void addFetchProfile(FetchProfile profile)
Specified by:
addFetchProfile in interface MetadataImplementor

addFilterDefinition

public void addFilterDefinition(FilterDefinition def)
Specified by:
addFilterDefinition in interface MetadataImplementor

getFilterDefinitions

public Iterable<FilterDefinition> getFilterDefinitions()
Specified by:
getFilterDefinitions in interface Metadata

addIdGenerator

public void addIdGenerator(IdGenerator generator)
Specified by:
addIdGenerator in interface MetadataImplementor

getIdGenerator

public IdGenerator getIdGenerator(String name)
Specified by:
getIdGenerator in interface Metadata

registerIdentifierGenerator

public void registerIdentifierGenerator(String name,
                                        String generatorClassName)
Specified by:
registerIdentifierGenerator in interface MetadataImplementor

addNamedNativeQuery

public void addNamedNativeQuery(NamedSQLQueryDefinition def)
Specified by:
addNamedNativeQuery in interface MetadataImplementor

getNamedNativeQuery

public NamedSQLQueryDefinition getNamedNativeQuery(String name)

getNamedNativeQueryDefinitions

public Iterable<NamedSQLQueryDefinition> getNamedNativeQueryDefinitions()
Specified by:
getNamedNativeQueryDefinitions in interface Metadata

addNamedQuery

public void addNamedQuery(NamedQueryDefinition def)
Specified by:
addNamedQuery in interface MetadataImplementor

getNamedQuery

public NamedQueryDefinition getNamedQuery(String name)

getNamedQueryDefinitions

public Iterable<NamedQueryDefinition> getNamedQueryDefinitions()
Specified by:
getNamedQueryDefinitions in interface Metadata

addResultSetMapping

public void addResultSetMapping(ResultSetMappingDefinition resultSetMappingDefinition)
Specified by:
addResultSetMapping in interface MetadataImplementor

getResultSetMappingDefinitions

public Iterable<ResultSetMappingDefinition> getResultSetMappingDefinitions()
Specified by:
getResultSetMappingDefinitions in interface Metadata

addTypeDefinition

public void addTypeDefinition(TypeDef typeDef)
Specified by:
addTypeDefinition in interface MetadataImplementor

getTypeDefinitions

public Iterable<TypeDef> getTypeDefinitions()
Specified by:
getTypeDefinitions in interface Metadata

getTypeDefinition

public TypeDef getTypeDefinition(String name)
Specified by:
getTypeDefinition in interface Metadata

getOptions

public Metadata.Options getOptions()
Specified by:
getOptions in interface Metadata

buildSessionFactory

public SessionFactory buildSessionFactory()
Specified by:
buildSessionFactory in interface Metadata

getServiceRegistry

public ServiceRegistry getServiceRegistry()
Specified by:
getServiceRegistry in interface BindingContext
Specified by:
getServiceRegistry in interface MetadataImplementor

locateClassByName

public <T> Class<T> locateClassByName(String name)
Specified by:
locateClassByName in interface BindingContext

makeJavaType

public Type makeJavaType(String className)
Specified by:
makeJavaType in interface BindingContext

makeClassReference

public Value<Class<?>> makeClassReference(String className)
Specified by:
makeClassReference in interface BindingContext

qualifyClassName

public String qualifyClassName(String name)
Specified by:
qualifyClassName in interface BindingContext

getDatabase

public Database getDatabase()
Specified by:
getDatabase in interface MetadataImplementor

getEntityBinding

public EntityBinding getEntityBinding(String entityName)
Specified by:
getEntityBinding in interface Metadata

getRootEntityBinding

public EntityBinding getRootEntityBinding(String entityName)
Description copied from interface: Metadata
Get the "root" entity binding

Specified by:
getRootEntityBinding in interface Metadata
Returns:
the "root entity binding; simply returns entityBinding if it is the root entity binding

getEntityBindings

public Iterable<EntityBinding> getEntityBindings()
Specified by:
getEntityBindings in interface Metadata

addEntity

public void addEntity(EntityBinding entityBinding)
Specified by:
addEntity in interface MetadataImplementor

getCollection

public PluralAttributeBinding getCollection(String collectionRole)

getCollectionBindings

public Iterable<PluralAttributeBinding> getCollectionBindings()
Specified by:
getCollectionBindings in interface Metadata

addCollection

public void addCollection(PluralAttributeBinding pluralAttributeBinding)
Specified by:
addCollection in interface MetadataImplementor

addImport

public void addImport(String importName,
                      String entityName)
Specified by:
addImport in interface MetadataImplementor

getImports

public Iterable<Map.Entry<String,String>> getImports()
Specified by:
getImports in interface Metadata

getFetchProfiles

public Iterable<FetchProfile> getFetchProfiles()
Specified by:
getFetchProfiles in interface Metadata

getTypeResolver

public TypeResolver getTypeResolver()
Specified by:
getTypeResolver in interface MetadataImplementor

getSessionFactoryBuilder

public SessionFactoryBuilder getSessionFactoryBuilder()
Specified by:
getSessionFactoryBuilder in interface Metadata

getNamingStrategy

public NamingStrategy getNamingStrategy()
Specified by:
getNamingStrategy in interface BindingContext

isGloballyQuotedIdentifiers

public boolean isGloballyQuotedIdentifiers()
Specified by:
isGloballyQuotedIdentifiers in interface BindingContext

setGloballyQuotedIdentifiers

public void setGloballyQuotedIdentifiers(boolean globallyQuotedIdentifiers)
Specified by:
setGloballyQuotedIdentifiers in interface MetadataImplementor

getMappingDefaults

public MappingDefaults getMappingDefaults()
Specified by:
getMappingDefaults in interface BindingContext

getGlobalMetaAttributeContext

public MetaAttributeContext getGlobalMetaAttributeContext()
Specified by:
getGlobalMetaAttributeContext in interface MetadataImplementor

getMetadataImplementor

public MetadataImplementor getMetadataImplementor()
Specified by:
getMetadataImplementor in interface BindingContext

getIdentifierGeneratorFactory

public IdentifierGeneratorFactory getIdentifierGeneratorFactory()
Description copied from interface: Mapping
Allow access to the id generator factory, though this is only needed/allowed from configuration.

Specified by:
getIdentifierGeneratorFactory in interface Mapping
Returns:
Access to the identifier generator factory

getIdentifierType

public Type getIdentifierType(String entityName)
                       throws MappingException
Specified by:
getIdentifierType in interface Mapping
Throws:
MappingException

getIdentifierPropertyName

public String getIdentifierPropertyName(String entityName)
                                 throws MappingException
Specified by:
getIdentifierPropertyName in interface Mapping
Throws:
MappingException

getReferencedPropertyType

public Type getReferencedPropertyType(String entityName,
                                      String propertyName)
                               throws MappingException
Specified by:
getReferencedPropertyType in interface Mapping
Throws:
MappingException


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.