-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: XML Export / Query Problem EntityMode.DOM4J
PostPosted: Tue Dec 19, 2006 9:09 am 
Newbie

Joined: Tue Dec 19, 2006 8:38 am
Posts: 3
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:
    <person id=1>
    </person>
...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_


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 9:20 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
my bet is that name and weight are null. But you're on the wrong forum :-)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 11:03 am 
Newbie

Joined: Tue Dec 19, 2006 8:38 am
Posts: 3
emmanuel wrote:
my bet is that name and weight are null. But you're on the wrong forum :-)


thx for the reply,
when i choose to load objects from type person, all attributes (name, weight) are not null.
btw: which forum should i use for my question?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 11:06 am 
Newbie

Joined: Tue Dec 19, 2006 8:38 am
Posts: 3
emmanuel wrote:
my bet is that name and weight are null. But you're on the wrong forum :-)


thx for the reply,
when i choose to load objects from type person, all attributes (name, weight) are not null.
btw: which forum should i use for my question?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 11:21 am 
Newbie

Joined: Wed Dec 13, 2006 5:49 am
Posts: 3
Location: Copenhagen
emmanuel wrote:
...you're on the wrong forum :-)


What would be the right forum for a question like the one above?
(About XML Relational Mapping, i.e.)

/
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 12:53 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
the regular user forum is the right one

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 1:19 pm 
Newbie

Joined: Wed Dec 13, 2006 5:49 am
Posts: 3
Location: Copenhagen
emmanuel wrote:
the regular user forum is the right one


Forgive my ignorance, but isn't this the one?

/
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 7:17 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
oups, you're correct, I though the post was on EJB 3.0. My bad :-)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.