[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1920) Incorrect documentation regarding XML manipulation in Hibernate reference manual (chapter 18.3).

Ignat Zapolsky (JIRA) noreply at atlassian.com
Mon Aug 13 17:50:13 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27808 ] 

Ignat Zapolsky commented on HHH-1920:
-------------------------------------

Original documentation shows incorrect code that will change root element instead of adding child nodes to it. Thanks for resolving this issue "very quickly" and "appropriately".

> Incorrect documentation regarding XML manipulation in Hibernate reference manual (chapter 18.3).
> ------------------------------------------------------------------------------------------------
>
>                 Key: HHH-1920
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1920
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 3.1.3
>            Reporter: Ignat Zapolsky
>            Assignee: Diego Pires Plentz
>            Priority: Trivial
>
> Manual has following sample (chapter 18.3):
> Session session = factory.openSession();
> Session dom4jSession = session.getSession(EntityMode.DOM4J);
> Transaction tx = session.beginTransaction();
> List results = dom4jSession
>     .createQuery("from Customer c left join fetch c.accounts where c.lastName like :lastName")
>     .list();
> for ( int i=0; i<results.size(); i++ ) {
>     //add the customer data to the XML document
>     Element customer = (Element) results.get(i);
>     doc.add(customer);
> }
> Mentioned code simply changes root node of doc, but supposed to add child elements.
> Correct code shall look like:
> Session session = factory.openSession();
> Session dom4jSession = session.getSession(EntityMode.DOM4J);
> Transaction tx = session.beginTransaction();
> List results = dom4jSession
>     .createQuery("from Customer c left join fetch c.accounts where c.lastName like :lastName")
>     .list();
> for ( int i=0; i<results.size(); i++ ) {
>     //add the customer data to the XML document
>     Element customer = (Element) results.get(i);
>     doc.getRootEelemnt().add(customer);
> }

-- 
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