Top Description Inners Fields Constructors Methods
org.hibernate.cfg

public final Class HbmBinder

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .HashSet, .Iterator, .Properties, .StringTokenizer, org.dom4j.Attribute, .Document, .Element, org.hibernate.CacheMode, .EntityMode, .FetchMode, .FlushMode, .MappingException, org.hibernate.engine.ExecuteUpdateResultCheckStyle, .FilterDefinition, .NamedQueryDefinition, .Versioning, org.hibernate.id.PersistentIdentifierGenerator, org.hibernate.mapping.Any, .Array, .AuxiliaryDatabaseObject, .Backref, .Bag, .Collection, .Column, .Component, .DependantValue, .Fetchable, .Filterable, .Formula, .IdentifierBag, .IdentifierCollection, .IndexBackref, .IndexedCollection, .Join, .JoinedSubclass, .KeyValue, .List, .ManyToOne, .Map, .MetaAttribute, .MetadataSource, .OneToMany, .OneToOne, .PersistentClass, .PrimitiveArray, .Property, .PropertyGeneration, .RootClass, .Selectable, .Set, .SimpleAuxiliaryDatabaseObject, .SimpleValue, .SingleTableSubclass, .Subclass, .Table, .ToOne, .TypeDef, .UnionSubclass, .UniqueKey, .Value, .FetchProfile, org.hibernate.persister.PersisterClassProvider, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, .JoinedSubclassEntityPersister, .SingleTableEntityPersister, .UnionSubclassEntityPersister, org.hibernate.type.DiscriminatorType, .ForeignKeyDirection, .Type, org.hibernate.util.JoinedIterator, .ReflectHelper, .StringHelper, org.hibernate.util.xml.XmlDocument, org.slf4j.Logger, .LoggerFactory

Walks an XML mapping document and produces the Hibernate configuration-time metamodel (the classes in the mapping package)
Author
Gavin King

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv abstract static class
private static interface
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private
HbmBinder()

Private constructor to disallow instantiation.

Method Summary

Modifier and TypeMethod and Description
public static void
bindAny(Element node, Any any, boolean isNullable, Mappings mappings)

public static void
bindArray(Element node, Array array, String prefix, String path, Mappings mappings, Map<K, V> inheritedMetas)

Called for arrays and primitive arrays

private static void
bindAuxiliaryDatabaseObject(Element auxDbObjectNode, Mappings mappings)

public static void
bindClass(Element node, PersistentClass persistentClass, Mappings mappings, Map<K, V> inheritedMetas)

public static void
bindCollection(Element node, Collection collection, String className, String path, Mappings mappings, Map<K, V> inheritedMetas)

Called for all collections

public static void
bindCollectionSecondPass(Element node, Collection collection, Map<K, V> persistentClasses, Mappings mappings, Map<K, V> inheritedMetas)

Called for all collections

public static void
bindColumn(Element node, Column column, boolean isNullable)

public static void
bindColumns(final Element node, final SimpleValue simpleValue, final boolean isNullable, final boolean autoColumn, final String propertyPath, final Mappings mappings)

private static void
bindColumnsOrFormula(Element node, SimpleValue simpleValue, String path, boolean isNullable, Mappings mappings)

private static void
bindComment(Table table, Element node)

public static void
bindComponent(Element node, Component component, String ownerClassName, String parentProperty, String path, boolean isNullable, boolean isEmbedded, Mappings mappings, Map<K, V> inheritedMetas, boolean isIdentifierMapper)

public static void
bindComposite(Element node, Component component, String path, boolean isNullable, Mappings mappings, Map<K, V> inheritedMetas)

private static void
bindCompositeId(Element idNode, RootClass entity, Mappings mappings, Map<K, V> inheritedMetas)

public static void
bindCompositeId(Element node, Component component, PersistentClass persistentClass, String propertyName, Mappings mappings, Map<K, V> inheritedMetas)

private static void
bindDiscriminatorProperty(Table table, RootClass entity, Element subnode, Mappings mappings)

private static void
bindDom4jRepresentation(Element node, PersistentClass entity, Mappings mappings, Map<K, V> inheritedMetas)

public static void
bindIdentifierCollectionSecondPass(Element node, IdentifierCollection collection, Map<K, V> persistentClasses, Mappings mappings, Map<K, V> inheritedMetas)

private static void
bindImport(Element importNode, Mappings mappings)

private static void
bindIndex(Attribute indexAttribute, Table table, Column column, Mappings mappings)

private static void
bindJoin(Element node, Join join, Mappings mappings, Map<K, V> inheritedMetas)

public static void
bindJoinedSubclass(Element node, JoinedSubclass joinedSubclass, Mappings mappings, Map<K, V> inheritedMetas)

public static void
bindListSecondPass(Element node, List list, Map<K, V> classes, Mappings mappings, Map<K, V> inheritedMetas)

Called for Lists, arrays, primitive arrays

private static void
bindManyToManySubelements(Collection collection, Element manyToManyNode, Mappings model)

public static void
bindManyToOne(Element node, ManyToOne manyToOne, String path, boolean isNullable, Mappings mappings)

private static void
bindMapRepresentation(Element node, PersistentClass entity, Mappings mappings, Map<K, V> inheritedMetas)

public static void
bindMapSecondPass(Element node, Map map, Map<K, V> classes, Mappings mappings, Map<K, V> inheritedMetas)

Called for Maps

private static void
bindNamedQuery(Element queryElem, String path, Mappings mappings)

private static void
bindNamedSQLQuery(Element queryElem, String path, Mappings mappings)

public static void
bindOneToMany(Element node, OneToMany oneToMany, Mappings mappings)

public static void
bindOneToOne(Element node, OneToOne oneToOne, String path, boolean isNullable, Mappings mappings)

private static void
bindPersistentClassCommonValues(Element node, PersistentClass entity, Mappings mappings, Map<K, V> inheritedMetas)

private static void
bindPojoRepresentation(Element node, PersistentClass entity, Mappings mappings, Map<K, V> metaTags)

public static void
bindProperty(Element node, Property property, Mappings mappings, Map<K, V> inheritedMetas)

private static void
bindResultSetMappingDefinition(Element resultSetElem, String path, Mappings mappings)

public static void
bindRoot(XmlDocument
The DOM to be parsed and bound.
metadataXml
,
Mappings
Current bind state.
mappings
,
Map<K, V>
Any inherited meta-tag information.
inheritedMetas
,
Set<String>
Any state
entityNames
)

The main contract into the hbm.xml-based binder.

public static void
bindRootClass(Element
The DOM Element for the <class/> element.
node
,
RootClass
The mapping instance to which to bind the information.
rootClass
,
Mappings
The current bind state.
mappings
,
Map<K, V>
Any inherited meta-tag information.
inheritedMetas
)

Responsible for perfoming the bind operation related to an <class/> mapping element.

private static void
bindRootPersistentClassCommonValues(Element node, Map<K, V> inheritedMetas, Mappings mappings, RootClass entity)

private static void
bindSimpleId(Element idNode, RootClass entity, Mappings mappings, Map<K, V> inheritedMetas)

public static void
bindSimpleValue(Element node, SimpleValue simpleValue, boolean isNullable, String path, Mappings mappings)

private static void
bindSimpleValueType(Element node, SimpleValue simpleValue, Mappings mappings)

public static void
bindSubclass(Element node, Subclass subclass, Mappings mappings, Map<K, V> inheritedMetas)

private static void
bindTypeDef(Element typedefNode, Mappings mappings)

public static void
bindUnionSubclass(Element node, UnionSubclass unionSubclass, Mappings mappings, Map<K, V> inheritedMetas)

private static void
bindUniqueKey(Attribute uniqueKeyAttribute, Table table, Column column, Mappings mappings)

private static void
bindVersioningProperty(Table table, Element subnode, Mappings mappings, String name, RootClass entity, Map<K, V> inheritedMetas)

private static String
protected static void
createClassProperties(Element node, PersistentClass persistentClass, Mappings mappings, Map<K, V> inheritedMetas)

protected static void
createClassProperties(Element node, PersistentClass persistentClass, Mappings mappings, Map<K, V> inheritedMetas, UniqueKey uniqueKey, boolean mutable, boolean nullable, boolean naturalId)

private static Property
createProperty(final Value value, final String propertyName, final String className, final Element subnode, final Mappings mappings, Map<K, V> inheritedMetas)

private static void
public static CacheMode
getCacheMode(String cacheMode)

private static String
public static String
getClassName(String unqualifiedName, Mappings model)

public static String
getClassName(String unqualifiedName, String defaultPackage)

private static String
getClassTableName(PersistentClass model, Element node, String schema, String catalog, Table denormalizedSuperTable, Mappings mappings)

public static String
public static List<String>

Returns:

The list of unresolved extends names.
getExtendsNeeded
(XmlDocument
The document to check
metadataXml
,
Mappings
The already processed mappings.
mappings
)

For the given document, locate all extends attributes which refer to entities (entity-name or class-name) not defined within said document.

public static final FlushMode
getFlushMode(String flushMode)

private static final Map<K, V>
getMetas(Element node, Map<K, V> inheritedMeta)

public static final Map<K, V>
getMetas(Element node, Map<K, V> inheritedMeta, boolean onlyInheritable)

private static int
public static Map<K, V>
private static String
private static ExecuteUpdateResultCheckStyle
getResultCheckStyle(Element element, boolean callable)

private static String
private static PersistentClass
getSuperclass(Mappings mappings, Element subnode)

public static String
private static void
private static void
private static void
private static void
handleJoinedSubclass(PersistentClass model, Mappings mappings, Element subnode, Map<K, V> inheritedMetas)

private static void
handleSubclass(PersistentClass model, Mappings mappings, Element subnode, Map<K, V> inheritedMetas)

private static void
handleUnionSubclass(PersistentClass model, Mappings mappings, Element subnode, Map<K, V> inheritedMetas)

private static void
initLaziness(Element node, Fetchable fetchable, Mappings mappings, String proxyVal, boolean defaultLazy)

private static void
initLaziness(Element node, ToOne fetchable, Mappings mappings, boolean defaultLazy)

private static void
private static boolean
private static boolean
isCallable(Element element, boolean supportsCallable)

private static Element

Returns:

The tuplizer element, or null.
locateTuplizerDefinition
(Element
The containing element (representing the entity/component)
container
,
EntityMode
The entity-mode for which to locate the tuplizer element
entityMode
)

Locate any explicit tuplizer definition in the metadata, for the given entity-mode.

private static void
makeIdentifier(Element node, SimpleValue model, Mappings mappings)

private static final void
private static void
parseFetchProfile(Element element, Mappings mappings, String containingEntityName)

private static void
parseFilter(Element filterElement, Filterable filterable, Mappings model)

private static void
parseFilterDef(Element element, Mappings mappings)

private static void
private static void
recognizeEntities(Mappings
The already processed mappings
mappings
,
final Element
The containing element
startNode
,
HbmBinder.EntityElementHandler
The thing that knows what to do whenever we recognize an entity-name
handler
)

Given an entity-containing-element (startNode) recursively locate all entity names defined within that element.

private static Class<T>
reflectedPropertyClass(String className, String propertyName)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait