-->
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.  [ 9 posts ] 
Author Message
 Post subject: Use DB + Hibernate instead of plain XML-Files?
PostPosted: Wed Nov 17, 2004 11:21 am 
Newbie

Joined: Wed Nov 17, 2004 11:01 am
Posts: 3
Location: Berlin, Germany
Hi @ all,

i need to find the right way to store (and retrieve) some very complex datastructures and keep in mind to be able to build some queries for whatever.
Ok so far. Let me try to explain these datastructures xml-like:

<Object>
<Attribute type="foo">bar</Attribute>
... // unknown amount of "Attribute" possible !

<item>
<foo type="string">bar</foo>
<foo type="float">bar</foo>
<foo type="bool">bar</foo>
... // unknown amount of "foo


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 11:24 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
XML files are never the right tool for data management. I recommend following the rules for data model design, using a relational logical data model that has been normalized and secured with proper constraints in a SQL implementation. Forget XML if you talk about data, its just a file format. It has the same support for data management as a CSV file.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 6:08 pm 
Beginner
Beginner

Joined: Thu Oct 14, 2004 9:50 am
Posts: 43
Take a look at castor for oql for xml.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 7:06 pm 
Regular
Regular

Joined: Mon Sep 20, 2004 8:42 am
Posts: 58
Location: Boston, US
The XML folks may claim that using an XML database is the right tool for this :)

PS: I'm not in the XML camp with respect to this issue.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 7:07 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
An XML database is a collection of XML documents. Uhm, great.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 7:32 pm 
Regular
Regular

Joined: Mon Sep 20, 2004 8:42 am
Posts: 58
Location: Boston, US
Sure - An XML database is a collection of XML documents but it does provide several services such as an XPath based query service, efficient retrieval of XML without requiring the client to parse the document, specifying constraints on XML documents via an XML Schema, which is more expressive than relational constraints.

An XML database is not suitable in many applications but it does provide value in certain applications that are inherently XML centric. Consider a WSDL catalog where the original data (the wsdl file itself) is XML. It would be more efficient to retrieve and query for services in the catalog was stored in an XML database as opposed to a relational database.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 4:48 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This sounds like it was copied from an XML database vendords marketing slide. Start here: http://www.amazon.com/exec/obidos/tg/de ... 0321197844

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: another view
PostPosted: Thu Nov 18, 2004 9:47 am 
Newbie

Joined: Wed Nov 17, 2004 11:01 am
Posts: 3
Location: Berlin, Germany
ok, thanks for your replies. lets take it from another point. the example i give you above is very abstract. Let me explain some details.
I


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 4:25 pm 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
From the technical point of view I have a similar project. We were foreced to import/export complex XML data into/from a DB.
We did the XML stuff with Castor and the DB access with hibernate.

Castor is fine if you have DTD/Schema and you want to be able to read/write the XML Data in a more convenient way than a simple DOM parser gives you. If you want to use it as a full XML-to-OO-Mapper its feature set is limited. Maybe JAXP is better we didn't try.

I guess you have the chance to create your DB from scratch. Then Hibernate 2 is great and chances are high, that you will save time compared to do everythin in plain JDBC.

I've put the XML and the Hibernate stuff underneath a DAO layer. This way the business logic is completely unaware of the data sources.

An other approach is to use XML DB features which give you the possibility to access XML data as if it's a DB table. Guess hibernate could help here as well. But I didn't really investigate a lot on this.

HTH
Ernst


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