-->
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.  [ 6 posts ] 
Author Message
 Post subject: XML Mapping and Annotations?!
PostPosted: Wed Mar 09, 2005 11:33 am 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
Is it possible to use the new XML-Mapping-Features together with Annotations?! I don't have class-specific mapping files and I haven't yet found any XML specific annotations - are there plans to have annotations to specifiy node and embed-xml?

cheers
stf


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 9:23 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I must admit it's quite strange to use annotation for a non pojo domain model.
So no, this is not planned.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 11:02 am 
Regular
Regular

Joined: Thu Feb 19, 2004 4:48 am
Posts: 62
Then maybe I did not quite understand the use of the XML Mappings: My requirements is to serialize an object-tree that I persisted with hibernate to XML to ship it to some (non-java-) client-applications. Isn't this one of the intended use-cases for the XML Mappings?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 12:13 pm 
Newbie

Joined: Tue Mar 08, 2005 6:04 pm
Posts: 4
This is exactly the same I would like to do. I also understood the xml mapping feature could to the trick. I'm still hoping someone could post some code snippet doing this things.

Regards,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 2:03 pm 
Beginner
Beginner

Joined: Thu Aug 26, 2004 5:53 am
Posts: 37
There is an example of this in the docs

http://www.hibernate.org/hib_docs/v3/re ... /#d0e10435

See 18.1.1. Specifying XML and class mapping together

This allows you to have both POJO and DOM4J XML mappings for the same entity.

As for merging the metadata for a .hbm.xml file and the anotations - I don't know if the hibernate Configuration supports that now - but it could certainly be written - are you volounteering ?

There is also sample code there about how to start a EntityMode.DOM4J session to extract the data in XML.

You can use a normal POJO session to create the POJO data in the database, and use a DOM4J session to extract it in xml.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2005 12:03 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
mugwump wrote:
Then maybe I did not quite understand the use of the XML Mappings: My requirements is to serialize an object-tree that I persisted with hibernate to XML to ship it to some (non-java-) client-applications. Isn't this one of the intended use-cases for the XML Mappings?

My bad, I've not had a look at that for now, so it's currently unplanned.

_________________
Emmanuel


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