There's no direct API to do what you want, sorry. Your code is probably the best way.
Florent On Fri, Dec 11, 2009 at 11:24 PM, Raymond Bourges <[email protected]> wrote: > Hi all, > > I use this code : > > //Retrieve liveVersion from version > DocumentModel liveVersion = session.getDocument(new > IdRef(docVersion.getSourceId())); > //get versionModels from liveVersion > List<VersionModel> versionModels = > session.getVersionsForDocument(liveVersion.getRef()); > //find in all VersionModel the one corresponding docVersion > VersionModel versionModel = null; > for (VersionModel tmp : versionModels) { > //get version document > DocumentModel versionDoc = > session.getDocumentWithVersion(liveVersion.getRef(), tmp); > if (versionDoc.equals(docVersion)) { > versionModel = tmp; > } > } > > Le 11/12/2009 15:21, Raymond Bourges a écrit : > > Hi all, > > I work with nuxeo 5.3 and SQL storage. > > In my code I have a DocumentModel object corresponding to a version of an > “original” DocumentModel object. I want to find the VersionModel object > “corresponding” to my DocumentModel object but I don't know how to do. > > I see relation in the database but I don't find how to do in java. > > Could you help me ? > > Thanks. > > _______________________________________________ > ECM mailing list > [email protected] > http://lists.nuxeo.com/mailman/listinfo/ecm > To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm > > > _______________________________________________ > ECM mailing list > [email protected] > http://lists.nuxeo.com/mailman/listinfo/ecm > To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm > > -- Florent Guillaume, Director of R&D, Nuxeo Open Source, Java EE based, Enterprise Content Management (ECM) http://www.nuxeo.com http://www.nuxeo.org +33 1 40 33 79 87 _______________________________________________ ECM mailing list [email protected] http://lists.nuxeo.com/mailman/listinfo/ecm To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm
