[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1920?page=c...
]
Diego Pires Plentz resolved HHH-1920.
-------------------------------------
Resolution: Rejected
"Mentioned code simply changes root node of doc, but supposed to add child
elements."
Closing as "rejected", since documentation are explicit saying that "add
the customer data to the XML document ", makes no sense to change the rootElement..
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira