-->
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.  [ 8 posts ] 
Author Message
 Post subject: Future of XML mapping files?
PostPosted: Mon Feb 20, 2006 2:55 pm 
Beginner
Beginner

Joined: Mon Aug 15, 2005 10:20 am
Posts: 32
Location: Brazil
I just read the Hibernate Annotations Reference Manual, and I see some great features which are not available via XML mapping files. It appears that new features (like Temporal Property mapping) are only being introduced in Annotations.

What is the future of XML mapping files? Are they being deprecated? Will they be updated to support all Annotation features?

Thanks in advance,
Daniel Serodio


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 3:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
temporal types is afaik just a subset of hibernates type system - why do you refer to it as something new ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 3:58 pm 
Beginner
Beginner

Joined: Mon Aug 15, 2005 10:20 am
Posts: 32
Location: Brazil
I mention Temporal Property mapping because I hadn't heard about it before, including the "Time-Slices Entities" thread (http://forum.hibernate.org/viewtopic.php?t=929382).

My main concern is actually Java 5 enums. In the "Persisting jdk1.5 enums today" thread (http://forum.hibernate.org/viewtopic.php?t=933393), it became clear to me that Annotation-based mappings have features that XML-based mappings don't. See (mine) second-to-last post in the JDK1.5 enum thread for example.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 4:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Temporal Property mapping has nothing to do with time-slicing.

And afaik the Java 5 enums is equally supported in hbm.xml afaik. You can just use the type defined in the annotations package in the hbm.xml.

again of course EJB 3 can use some of the enhancements in Java 5 we cant directly support in Hibernate for compability reasons - but again, enums works fine in both worlds afaik.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 4:54 pm 
Beginner
Beginner

Joined: Mon Aug 15, 2005 10:20 am
Posts: 32
Location: Brazil
Quote:
Temporal Property mapping has nothing to do with time-slicing.

I'm using the nomenclature coined by Martin Fowler's Analysis Patterns "Patterns for things that change with time" article (http://www.martinfowler.com/ap2/timeNarrative.html).

As I understand it, Temporal Property == "time-sliced" property.
The "Time-Slices Entities" thread describe what Fowler calls "Temporal Object", which is also called "Version History"

Aren't Temporal Property and Temporal Object closely related?
Quote:
And afaik the Java 5 enums is equally supported in hbm.xml afaik. You can just use the type defined in the annotations package in the hbm.xml.

Please read my comment on the mentioned thread (http://forum.hibernate.org/viewtopic.ph ... 34#2283334); as far as this Forum's community knows, it's not possible to use a "XML mapped" enum as a query parameter, while it is possible with a "annotation mapped" enum.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 4:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no Temporal just mean "something that is time related". temporal property is just EJB3 terms for what you from hibernate knows as date, time and timestamp.

again, using the same type as the one in annotations should give you the same features (assuming you are using hibernate3 api and not ejb3 api)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 6:28 pm 
Beginner
Beginner

Joined: Mon Aug 15, 2005 10:20 am
Posts: 32
Location: Brazil
Okay, I misunderstood the Temporal Property mapping then.

WRT enums, I just tried what you suggested, but I've found that in order to
Quote:
use the same type as the one in annotations

I'd need to use Hibernate 3.1 (because of org.hibernate.util.ReflectHelper.classForName), and 3.1 is not backwards-compatible with Hibernate 3.0, which I'm currently using (see HHH-1435 for example).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 12:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
..so copy and change it to use the older reflecthelper if you want to run it on hibernate 3.0

_________________
Max
Don't forget to rate


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