hello,
i was trying to get a query-result as xml to pass to xslt processor.
what i have done:
Code:
...
Session session= HibernateSessionFactory.currentSession();
Transaction tx= session.beginTransaction();
Session xmlSession = session.getSession(EntityMode.DOM4J);
List results = xmlSession.createQuery("from Person").list();
...
printing the list gives me something like this:
...nodes "weight" and "name" are missing...
what i wanted to get :
<person id=1>
<name>...</name>
<weight>... </weight>
</person>
my question is how to get the desired result?
is such xml export possible? if, what do i miss?
thanks in advance
oakad
Hibernate version:3.2.1 GA Mapping documents:<hibernate-mapping>
<class name="Person"
table="person" schema="public node="person">
<id name="id" type="long" column="id" length="8" node="@id">
<generator class="identity" />
</id>
<property name="name" type="string" column="name" length="255"
node="name" />
<property name="weight" type="integer" column="weight"
length="4" node="weight" />
</class>
Name and version of the database you are using:
PostgreSQL 8.1
The generated SQL (show_sql=true):
Hibernate: select person0_.id as id, person0_.name as name0_, person0_.weight as weight0_ from public.person person0_