-->
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.  [ 3 posts ] 
Author Message
 Post subject: implementing time sliced entities using filters
PostPosted: Mon Dec 17, 2007 10:40 am 
Newbie

Joined: Mon Dec 17, 2007 10:27 am
Posts: 3
I'm trying to implement some sort of time slicing for my entities. I'm using JPA and Hibernate.

So far, I've come up with a conceptual idea:

For an entity X I need an XVersion entity. X contains a list of XVersion entities. X contains an id and static data, XVersion contains time-sliced data (containing a validFrom and validTo field). Now I don't want to get every XVersion in X, only the currently valid one (date between validFrom and validTo).
I think I can achieve this through adding a where clause into my query (select x from X left join fetch x.versions where :date between x.versions.validFrom and x.versions.validTo), but I'd rather use the @Filter annotation on my collection.
However, when I add a filter on the collection with a condition, JPA (or Hibernate) does not filter the collection on the condition I had given.

Am I missing something? Did it forget something concerning the filter? I read the Filter documentation on Hibernate Annotations, but I couldn't find what I missed.

Does Hibernate (or even JPA for that matter) support time-slicing of entities? It seems such a widely spread concept, but I haven't found information about it concerning JPA implementation.


Top
 Profile  
 
 Post subject: I am facing the same issue.
PostPosted: Mon Dec 24, 2007 3:54 am 
Newbie

Joined: Mon Dec 24, 2007 2:04 am
Posts: 6
Hi lievendoclo,
did you find a solution to your problem? if so, can you please share it with us?

Thanks and Best Regards,
Itsik.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 31, 2007 7:17 am 
Newbie

Joined: Mon Oct 01, 2007 12:42 pm
Posts: 13
Location: Helsinki, Finland
I am working on time slicing as well, and I think I have a working solution similar to yours. Can you please post the annotations you have used in your entity classes so we can take a look at them?

Regards,
Immo


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