-->
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.  [ 2 posts ] 
Author Message
 Post subject: Map in xml file
PostPosted: Wed Aug 02, 2006 4:31 pm 
Newbie

Joined: Wed Aug 02, 2006 4:19 pm
Posts: 2
Location: Chile
Hello, i need persist a class in a xml file, i see documentation and find


Chapter 18. XML Mapping
·
·
·
18.1.2. Specifying only an XML mapping

but i can't find the configuration to my hibernate.cfg.xml
to tell it don't use a data base, use a xml file to persist my class

<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="connection.url">jdbc:hsqldb:hsql://localhost</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
.... etc.

someone know how can i do this

_________________
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 02, 2006 7:19 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
You need to set the entity mode to dom4j. In you .cfg.xml you can set hibernate.default_entity_mode to dom4j, but if you only want some classes to be saved to XML, and the rest save to a DB, then the easiest thing to do is to get a dom4j session from your existing (DB) session. Use session.getSession(EntityMode.DOM4J).

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.