-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate 3.0 export xml
PostPosted: Tue Apr 05, 2005 9:26 am 
Newbie

Joined: Tue Apr 05, 2005 9:13 am
Posts: 1
Hi everybody,
I'm using Hibernate from 2 weeks.
I have a problem with xml export

Extract of mapping file:
....
<class name="test.hibernate.Sede" table="SEDE">
<id name="Id" type="java.math.BigDecimal" node="@id">
<column name="ID" length="22" not-null="true" unique="true" sql-type="NUMBER" />
<generator class="assigned" />
</id>

<property name="Descrizione" type="java.lang.String" node="@descr">
<column name="DESCRIZIONE" length="30" not-null="false" unique="true" sql-type="VARCHAR2" />
</property>
....

Extract of code:
...
session.getSession(EntityMode.DOM4J);
Transaction tx = session_xml.beginTransaction();
Criteria criteria = session_xml.createCriteria(Sede.class);
lista_result = criteria.list();
...

The field Descrizione can be null in the database and I would like to have
<sede id="100" descrizione=""/>, but I have <sede id="100">. How can I put the empty attribute, corresponding to a null value?

Can you help me?

Thanks in advance.

Marta


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

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.