|Re: [CDO] revisions or versions list. [message #1059374 is a reply to message #1059373]
||Fri, 17 May 2013 17:52
| Eike Stepper
Registered: July 2009
Am 17.05.2013 19:43, schrieb Warwick Burrows:|
> This is how I have successfully gotten a specific version:
> First get the object, then CDOUtil.getRevisionByVersion() to get the specific version, the get that versions
> timestamp, set it in the view and get by id. I've confirmed this gets the revision of the object that I request.
> CDOObject latest = transaction.getObject(cdoID);
> CDORevision specificRev = CDOUtil.getRevisionByVersion(latest, version);
> CDOID revId = specificRev.getID();
Here revID is identical to cdoID.
Not sure what mapRev is, but setTimeStamp() delegates to setBranchPoint(), which is overridden in CDOTransactionImpl:
public synchronized boolean setBranchPoint(CDOBranchPoint branchPoint)
if (branchPoint.getTimeStamp() != UNSPECIFIED_DATE)
throw new IllegalArgumentException("Changing the target time is not supported by transactions");
if (isDirty() && !getBranch().equals(branchPoint.getBranch()))
throw new IllegalStateException("Changing the target branch is impossible while transaction is dirty");
I.e. you can't change the timestamp (of a transaction) to anything but UNSPECIFIED_DATE, or in wother words, you can't
modify the past.
> CDOObject chosen = getObjectById(revId);
What exactly does getObjectById() do and how?
> I would *assume* that setting the timestamp on the view will permanently set the view at this revision until the
> transaction is closed, which is ok if this is all you're going to do with the transaction. I don't know this for sure
> though as I haven't tested it. I'm about to ask this question to the forum in fact.
Powered by FUDForum
. Page generated in 0.01854 seconds