-->
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.  [ 7 posts ] 
Author Message
 Post subject: XML -> DB with hibernate, whats the most used?
PostPosted: Wed Oct 26, 2005 10:31 am 
Beginner
Beginner

Joined: Tue Aug 23, 2005 4:59 pm
Posts: 31
Am I correct in saying that Hibernate does not provide a XML to java class mapper ? If so what is the most common way to first validate a XML file, map it to POJO files and then persist it with hibernate?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 10:45 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
I don't know what you mean by validate a xml file but if you do it right you don't have to write the xml files or pojos at all.

middlegen can create the mapping files from your database, with a nice little gui, then hbm2java (comes with hibernate) can turn those xml files into POJOs

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 10:51 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate does not provide an XML -> POJO mapper but it provides an XML -> DB mapper. No need for an intermediate layer unless you need it in your application.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 10:56 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
hehe, you weren't talking about writing code. I misunderstood your question.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 11:03 am 
Beginner
Beginner

Joined: Tue Aug 23, 2005 4:59 pm
Posts: 31
emmanuel wrote:
Hibernate does not provide an XML -> POJO mapper but it provides an XML -> DB mapper. No need for an intermediate layer unless you need it in your application.


So my overall desire is to take xml files from a 3rd party, validate them and spit out errors, or import them into the database. Where did I miss this documentation on how to do this with hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 4:22 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Chapter 19. XML mappings

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 4:25 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
ericchile wrote:
emmanuel wrote:
Hibernate does not provide an XML -> POJO mapper but it provides an XML -> DB mapper. No need for an intermediate layer unless you need it in your application.


So my overall desire is to take xml files from a 3rd party, validate them and spit out errors, or import them into the database. Where did I miss this documentation on how to do this with hibernate?


Hibernate doesn't supply a XML Validating framework. Chapter 19. XML mappings however does provide a means of taking XML and persisting it into the Database using Hibernate Mapping files. No POJO's required.

You should be aware that this functionality is still listed as experimental.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


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