[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1340) XML Element and Attribute Names For HBM Should Be Constants
Steve Ebersole (JIRA)
noreply at atlassian.com
Mon Mar 21 13:00:35 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list