Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How can I query all past versions of an object with eclipselink?..
How can I query all past versions of an object with eclipselink?.. [message #646014] Tue, 21 December 2010 10:13 Go to next message
Gursel Koca is currently offline Gursel Koca
Messages: 4
Registered: December 2010
Junior Member
By means of historical session, we can query an object at a specific time. But what I need is to query all the versions of that object..

The documentation points out that we can not do this..How can I
query all previous versions of an object?.
Re: How can I query all past versions of an object with eclipselink?.. [message #646328 is a reply to message #646014] Thu, 23 December 2010 06:23 Go to previous messageGo to next message
Gursel Koca is currently offline Gursel Koca
Messages: 4
Registered: December 2010
Junior Member
There is no answer. It means that it is not possible.. But with hibernate envers, it is very easy to get this functionality.
Re: How can I query all past versions of an object with eclipselink?.. [message #647150 is a reply to message #646328] Tue, 04 January 2011 13:43 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

There does not seem to be an easy way to do this. Please log an enhancement request and vote for it.

You can use a native SQL query for this. You will need to set "eclipselink.maintain-cache"="true" on the query.

You could also map a separate class to the historical table, and include the start and end date in the object, and the startDate as part of the Id. This is really what you would want to do, as querying the original class will not give you access to the start and end dates. You could use a MappedSuperclass and have the current and historical class subclass it and use the different tables.



James : Wiki : Book : Blog : Twitter
Previous Topic:Lazy load on OneToMany mapping does not work
Next Topic:CriteriaBuilder aborted
Goto Forum:
  


Current Time: Sat Aug 23 11:38:43 EDT 2014

Powered by FUDForum. Page generated in 0.02386 seconds