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
|