Package org.hibernate.cfg
Class HbmBinder
java.lang.Object
org.hibernate.cfg.HbmBinder
Walks an XML mapping document and produces the Hibernate configuration-time metamodel (the
classes in the mapping package)
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidbindAny(org.dom4j.Element node, Any any, boolean isNullable, Mappings mappings) static voidbindArray(org.dom4j.Element node, Array array, String prefix, String path, Mappings mappings, Map inheritedMetas) Called for arrays and primitive arraysstatic voidbindClass(org.dom4j.Element node, PersistentClass persistentClass, Mappings mappings, Map inheritedMetas) static voidbindCollection(org.dom4j.Element node, Collection collection, String className, String path, Mappings mappings, Map inheritedMetas) Called for all collectionsstatic voidbindCollectionSecondPass(org.dom4j.Element node, Collection collection, Map persistentClasses, Mappings mappings, Map inheritedMetas) Called for all collectionsstatic voidbindColumn(org.dom4j.Element node, Column column, boolean isNullable) static voidbindColumns(org.dom4j.Element node, SimpleValue simpleValue, boolean isNullable, boolean autoColumn, String propertyPath, Mappings mappings) static voidbindComponent(org.dom4j.Element node, Component component, String ownerClassName, String parentProperty, String path, boolean isNullable, boolean isEmbedded, Mappings mappings, Map inheritedMetas, boolean isIdentifierMapper) static voidbindComposite(org.dom4j.Element node, Component component, String path, boolean isNullable, Mappings mappings, Map inheritedMetas) static voidbindCompositeId(org.dom4j.Element node, Component component, PersistentClass persistentClass, String propertyName, Mappings mappings, Map inheritedMetas) static voidbindIdentifierCollectionSecondPass(org.dom4j.Element node, IdentifierCollection collection, Map persistentClasses, Mappings mappings, Map inheritedMetas) static voidbindJoinedSubclass(org.dom4j.Element node, JoinedSubclass joinedSubclass, Mappings mappings, Map inheritedMetas) static voidbindListSecondPass(org.dom4j.Element node, List list, Map classes, Mappings mappings, Map inheritedMetas) Called for Lists, arrays, primitive arraysstatic voidbindManyToOne(org.dom4j.Element node, ManyToOne manyToOne, String path, boolean isNullable, Mappings mappings) static voidbindMapSecondPass(org.dom4j.Element node, Map map, Map classes, Mappings mappings, Map inheritedMetas) Called for Mapsstatic voidbindOneToMany(org.dom4j.Element node, OneToMany oneToMany, Mappings mappings) static voidbindOneToOne(org.dom4j.Element node, OneToOne oneToOne, String path, boolean isNullable, Mappings mappings) static voidbindProperty(org.dom4j.Element node, Property property, Mappings mappings, Map inheritedMetas) static voidThe main contract into the hbm.xml-based binder.static voidbindRootClass(org.dom4j.Element node, RootClass rootClass, Mappings mappings, Map inheritedMetas) Responsible for perfoming the bind operation related to an <class/> mapping element.static voidbindSimpleValue(org.dom4j.Element node, SimpleValue simpleValue, boolean isNullable, String path, Mappings mappings) static voidbindSubclass(org.dom4j.Element node, Subclass subclass, Mappings mappings, Map inheritedMetas) static voidbindUnionSubclass(org.dom4j.Element node, UnionSubclass unionSubclass, Mappings mappings, Map inheritedMetas) protected static voidcreateClassProperties(org.dom4j.Element node, PersistentClass persistentClass, Mappings mappings, Map inheritedMetas) protected static voidcreateClassProperties(org.dom4j.Element node, PersistentClass persistentClass, Mappings mappings, Map inheritedMetas, UniqueKey uniqueKey, boolean mutable, boolean nullable, boolean naturalId) static CacheModegetCacheMode(String cacheMode) static StringgetClassName(String unqualifiedName, String defaultPackage) static StringgetClassName(String unqualifiedName, Mappings model) static StringgetEntityName(org.dom4j.Element elem, Mappings model) getExtendsNeeded(XmlDocument metadataXml, Mappings mappings) For the given document, locate all extends attributes which refer to entities (entity-name or class-name) not defined within said document.static final FlushModegetFlushMode(String flushMode) static final MapgetMetas(org.dom4j.Element node, Map inheritedMeta, boolean onlyInheritable) static MapgetParameterTypes(org.dom4j.Element queryElem) static String
-
Method Details
-
bindRoot
public static void bindRoot(XmlDocument metadataXml, Mappings mappings, Map inheritedMetas, Set<String> entityNames) throws MappingException The main contract into the hbm.xml-based binder. Performs necessary binding operations represented by the given DOM.- Parameters:
metadataXml- The DOM to be parsed and bound.mappings- Current bind state.inheritedMetas- Any inherited meta-tag information.entityNames- Any state- Throws:
MappingException
-
bindRootClass
public static void bindRootClass(org.dom4j.Element node, RootClass rootClass, Mappings mappings, Map inheritedMetas) throws MappingException Responsible for perfoming the bind operation related to an <class/> mapping element.- Parameters:
node- The DOM Element for the <class/> element.rootClass- The mapping instance to which to bind the information.mappings- The current bind state.inheritedMetas- Any inherited meta-tag information.- Throws:
MappingException
-
bindClass
public static void bindClass(org.dom4j.Element node, PersistentClass persistentClass, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
bindUnionSubclass
public static void bindUnionSubclass(org.dom4j.Element node, UnionSubclass unionSubclass, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
bindSubclass
public static void bindSubclass(org.dom4j.Element node, Subclass subclass, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
bindJoinedSubclass
public static void bindJoinedSubclass(org.dom4j.Element node, JoinedSubclass joinedSubclass, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
bindColumns
public static void bindColumns(org.dom4j.Element node, SimpleValue simpleValue, boolean isNullable, boolean autoColumn, String propertyPath, Mappings mappings) throws MappingException - Throws:
MappingException
-
bindSimpleValue
public static void bindSimpleValue(org.dom4j.Element node, SimpleValue simpleValue, boolean isNullable, String path, Mappings mappings) throws MappingException - Throws:
MappingException
-
bindProperty
public static void bindProperty(org.dom4j.Element node, Property property, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
bindCollection
public static void bindCollection(org.dom4j.Element node, Collection collection, String className, String path, Mappings mappings, Map inheritedMetas) throws MappingException Called for all collections- Throws:
MappingException
-
bindManyToOne
public static void bindManyToOne(org.dom4j.Element node, ManyToOne manyToOne, String path, boolean isNullable, Mappings mappings) throws MappingException - Throws:
MappingException
-
bindAny
public static void bindAny(org.dom4j.Element node, Any any, boolean isNullable, Mappings mappings) throws MappingException - Throws:
MappingException
-
bindOneToOne
public static void bindOneToOne(org.dom4j.Element node, OneToOne oneToOne, String path, boolean isNullable, Mappings mappings) throws MappingException - Throws:
MappingException
-
bindOneToMany
public static void bindOneToMany(org.dom4j.Element node, OneToMany oneToMany, Mappings mappings) throws MappingException - Throws:
MappingException
-
bindColumn
public static void bindColumn(org.dom4j.Element node, Column column, boolean isNullable) throws MappingException - Throws:
MappingException
-
bindArray
public static void bindArray(org.dom4j.Element node, Array array, String prefix, String path, Mappings mappings, Map inheritedMetas) throws MappingException Called for arrays and primitive arrays- Throws:
MappingException
-
bindComposite
public static void bindComposite(org.dom4j.Element node, Component component, String path, boolean isNullable, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
bindCompositeId
public static void bindCompositeId(org.dom4j.Element node, Component component, PersistentClass persistentClass, String propertyName, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
bindComponent
public static void bindComponent(org.dom4j.Element node, Component component, String ownerClassName, String parentProperty, String path, boolean isNullable, boolean isEmbedded, Mappings mappings, Map inheritedMetas, boolean isIdentifierMapper) throws MappingException - Throws:
MappingException
-
getTypeFromXML
- Throws:
MappingException
-
createClassProperties
protected static void createClassProperties(org.dom4j.Element node, PersistentClass persistentClass, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
createClassProperties
protected static void createClassProperties(org.dom4j.Element node, PersistentClass persistentClass, Mappings mappings, Map inheritedMetas, UniqueKey uniqueKey, boolean mutable, boolean nullable, boolean naturalId) throws MappingException - Throws:
MappingException
-
bindListSecondPass
public static void bindListSecondPass(org.dom4j.Element node, List list, Map classes, Mappings mappings, Map inheritedMetas) throws MappingException Called for Lists, arrays, primitive arrays- Throws:
MappingException
-
bindIdentifierCollectionSecondPass
public static void bindIdentifierCollectionSecondPass(org.dom4j.Element node, IdentifierCollection collection, Map persistentClasses, Mappings mappings, Map inheritedMetas) throws MappingException - Throws:
MappingException
-
bindMapSecondPass
public static void bindMapSecondPass(org.dom4j.Element node, Map map, Map classes, Mappings mappings, Map inheritedMetas) throws MappingException Called for Maps- Throws:
MappingException
-
bindCollectionSecondPass
public static void bindCollectionSecondPass(org.dom4j.Element node, Collection collection, Map persistentClasses, Mappings mappings, Map inheritedMetas) throws MappingException Called for all collections- Throws:
MappingException
-
getFlushMode
-
getCacheMode
-
getParameterTypes
-
getMetas
public static final Map getMetas(org.dom4j.Element node, Map inheritedMeta, boolean onlyInheritable) -
getEntityName
-
getClassName
-
getClassName
-
getExtendsNeeded
For the given document, locate all extends attributes which refer to entities (entity-name or class-name) not defined within said document.- Parameters:
metadataXml- The document to checkmappings- The already processed mappings.- Returns:
- The list of unresolved extends names.
-