[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1920?page=c...
]
Diego Pires Plentz reopened HHH-1920:
-------------------------------------
Sorry Ignat. I'm won't understand what you are trying to say, but after your last
comment i figured out and found that I'm wrong. Sorry and thanks for this ;-)
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