]
Steve Ebersole closed HHH-1340.
-------------------------------
Closing stale resolved issues
XML Element and Attribute Names For HBM Should Be Constants
-----------------------------------------------------------
Key: HHH-1340
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1340
Project: Hibernate Core
Issue Type: Improvement
Components: core
Environment: Hibernate 3
Reporter: Adam Krouskop
Priority: Minor
Original Estimate: 1h
Remaining Estimate: 1h
It would be nice if the org.hibernate.cfg.HbmBinder class defined constants for all the
Element and Attribute names used in the HBM XML Schema.
Here is the use case prompting this recommendation: I'm using dynamic models to
persist maps and I'm generating mappings for these maps at run time, so I'm
programmatically creating the <hibernate-mapping> XML. I'd prefer if I could
replace my code that looks like this:
hmE = doc.createElement("hibernate-mapping");
doc.appendChild(hmE);
classE = doc.createElement("class");
classE.setAttribute("entity-name", entity);
hmE.appendChild(classE);
...
with this:
hmE = doc.createElement(HbmBinder.HIBERNATE_MAPPING_ELEMENT);
doc.appendChild(hmE);
classE = doc.createElement(HbmBinder.CLASS_ELEMENT);
classE.setAttribute(HbmBinder.ENTITY_NAME_ATTRIBUTE, entity);
hmE.appendChild(classE);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: